forked from openFrameworks-RaspberryPi/openFrameworks
-
Notifications
You must be signed in to change notification settings - Fork 0
Sound programming notes
damiannz edited this page Oct 2, 2012
·
57 revisions
- move instance out of ofBasicSoundPlayer, make singleton
- deal with singleton/root ofSoundStream instance: need some way of selecting the output at startup
- audioOut is called on the sound card's rendering thread, not the main thread. Make sure your audioOut is threadsafe but DON'T do this by using standard mutexes etc. Don't block! Don't do file I/O! If you need to do a lot of work, do it in a different thread that writes to a lock-free FIFO and read from this FIFO in audioOut. See Ross Bencina's guide for tips.
- audioOut's
float* outputcomes pre-cleared: audioOut does not need to set to 0 if it doesn't render anything - always assert that the input bufferSize and nChannels are what it expects. be smart enough to render multiple times