OSX equivalent of piping sound to linux's aplay
I had high hopes for redirection/piping, but afplay /dev/stdin <<< $(generate_sound.py)
failed for all the formats I tried. Sadly afplay
doesn't let you specify the format, and so it tries instead to sniff it which probably involves seeking which doesn't work with pipes.
I think you'd better find another command line player. sox seems like a good candidate. And! It's installable via homebrew: brew install sox
and you can pipe data to it like so:
cat whatever.raw | play -t raw -e floating-point -b 32 -c 2 -r 44100 -