Windows – Windows equivalent to the Linux “aplay” that will accept a bitstream and output audio

audiocommand linewindows

I was watching a Computerphile video about code golf and chiptunes and was interested in running the example code provided, but it relies on aplay, a Linux utility for the ALSA sound card driver, and I'd like to run this on Windows 7. Is there an equivalent program or utility on Windows 7+ (preferably but not necessarily OS-provided) that will take a stream of bytes and convert it to an audio stream?

Best Answer

same :)

I found you can use ffmpeg to convert it

ffmpeg -f u8 -i music.raw music.wav

Then use whatever you like to play it

Now, I tried piping it directly (vlc allows input on stdin, but it won't read raw data, at least not without arguments I'm not sure how to give it lol)

music.exe | ffmpeg ... -i pipe:1 | vlc.exe -

but ffmpeg said the pipe didn't have enough space (I tried pipe:0 as well since I wasn't 100% sure which it be for stdin on windows...)

so I ended up redirecting music.exe to a music.raw file for a small amount of time (music.exe > music.raw) then I could use this to pipe straight from ffmpeg to vlc

ffmpeg.exe -f u8 -i music.raw -f wav pipe:1 | vlc.exe -
Related Question