OfSoundStream vs. OfSoundPlayer

Hello OF ers,

I am creating an installation where I need to send audio to 4 pairs of bluetooth stereo wireless headphones and I would like to control each of the 8 audio channels individually.

I’ve been struggling to figure out how to play back sound from a .wav file through the ofsoundstream object to a specific channel on an aggregated device.

Any sample code on how to do this would be much appreciated.

Thank you in advance for any suggestions.

Hi,
the idea behind the ofSoundStream is to either grab sound data from the sound card or to output to it a synthesized or processed sound. On the other hand the ofSoundPlayer uses an external library, defined by the platform that you are using, to play back sounds but there’s no audio data access. So, ofSoundPlayer and ofSoundStream are kind of separate things.
Some months ago, at the YCAM dev con, we (adam carlucci, marek bareza, arturo and me) implemented a new audio subsystem that lets you have the audio player conected to the soundstream and access it’s data as well as it’s routing. It’s quite nice :slight_smile: yet it still need to be tested along all platforms to be able to release it. the idea is to release it soon although.
So, I’d encourage you to go to adam’s github and pull from its branch.


It has some examples and it will let you do what you are willing to do quite easily.
if you have any doubt let me know.
best!

Thanks for the advice!

I managed to get wav files going to different outputs via ofxmaxmillian. I will return back to this and check out the code you suggested. My current challenge is interfacing with multiple bluetooth headphones simultaneously. Thus far I haven’t been able to play unique audio files out of the different channels of my aggregated device.

I posted about this on stack overflow.

My plan B is using an external sound card which will communicate with different fm transmitters, which will correspond to various wireless headphones.