Skip to content

Samples preview on Linux while using Jack Audio Connection Kit #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
b1tfl0w opened this issue Apr 13, 2020 · 2 comments
Open

Samples preview on Linux while using Jack Audio Connection Kit #28

b1tfl0w opened this issue Apr 13, 2020 · 2 comments

Comments

@b1tfl0w
Copy link

b1tfl0w commented Apr 13, 2020

The vscode-tidalcycles extension makes use of node-wav-player, which on Linux systems uses aplay for playing sounds, aplay is good for ALSA but if you are using jack it will throw an error: Failed to play the wav file. To solve this just open the file:
~/.vscode/extensions/tidalcycles.vscode-tidalcycles-1.4.1/node_modules/node-wav-player/lib/wav-player.js
and replace aplay in the linux part where it says this._proc = mSpawn('aplay', [path]); with mpv

		if (os === 'win32') {
			this._proc = mSpawn('powershell', [
				'-c',
				'(New-Object System.Media.SoundPlayer "' + path + '").PlaySync();'
			]);
			this._proc.stdin.end();
		} else if (os === 'darwin') {
			this._proc = mSpawn('afplay', [path]);
		} else if (os === 'linux') {
			this._proc = mSpawn('mpv', [path]);
		} else {
			reject(new Error('The wav file can not be played on this platform.'));
		}

of course you will have to install mpv player:
sudo apt install mpv
mpv will play fine with jack aswell in alsa, becouse it will automatically detect the audio backend in use.

@kindohm
Copy link

kindohm commented Mar 27, 2025

I've suggested that the sound browser feature be removed in #44.

@kindohm kindohm added wontfix This will not be worked on and removed wontfix This will not be worked on labels Mar 27, 2025
@kindohm
Copy link

kindohm commented Apr 3, 2025

Will revisit this after considering whether sound browser will be added back into this extension. I still feel that it should be its own extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants