4 ms·
Where is /dev/audio on OS X?
by thmzlt 15y ago
Where is /dev/audio on OS X?
- a1k0n 15y agoI think you'd have to write some kind of CoreAudio stub. But if you just want to play with this stuff, see the Javascript version here: http://wurstcaptures.untergrund.net/music/ http://wurstcaptures.untergrund.net/music/
- Ogre 15y agoI don't know if there's a way to play it real-time. I was trying to install sox from homebrew, but it can't grab its libogg dependency, downloads.xiph.org isn't working right now, seemingly. However, you can do this: $ ./soundprog > temp.au hit CTRL-C (Hit it fast! You don't need it to run very long, and it will write to the resulting file very very quickly! Consider modifying the code to have a limit on the for loop.) Then open the resulting .au file in Audacity (http://audacity.sourceforge.net/ http://audacity.sourceforge.net/). It'll play fine. Not as simple just writing to a sound device, but it works.
- Ogre 15y agoOk, looks like xiph.org was just having a hiccup. You can do it real time with sox. First, Get sox. I prefer homebrew for Unix type stuff (http://mxcl.github.com/homebrew/ http://mxcl.github.com/homebrew/), but it's likely MacPorts, Fink, and other sources have sox available too. If using Homebrew, just: $ brew install sox Compile your program. Run it like this: $ ./soundprog | sox -r 8000 -t u8 - -d Voila, just like having a sound device. You can play with the 8000 to make it faster or slower (modifying the pitch as well).