Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple ofSoundStreams don't work #5519

Closed
bangnoise opened this issue Apr 4, 2017 · 4 comments
Closed

multiple ofSoundStreams don't work #5519

bangnoise opened this issue Apr 4, 2017 · 4 comments

Comments

@bangnoise
Copy link
Contributor

This applies to macOS (tested on 10.12.4) and Linux (tested on Ubuntu 16.10), OF 0.9.8 and current master.

Create and start multiple output ofSoundStreams, the audioOut callback for only one of them will be called.

On Ubuntu behaviour is even less predictable and the X server can lock up.

Windows appears to work.

Demo project at https://github.com/bangnoise/MultiSoundStream - Xcode project is for current master/0.10, QtCreator project for Ubuntu and a VS project for 0.9.8.

@arturoc
Copy link
Member

arturoc commented Apr 4, 2017

are you using more than one sound card?

@bangnoise
Copy link
Contributor Author

no

@arturoc
Copy link
Member

arturoc commented Apr 4, 2017

ofSoundStream is pretty low level and should be used only for 1 sound card or in some multichannel cards for each stereo pair or similar. if you need to mix several waves as it seems you are trying to do you need to add the outputs of every object in one final buffer and only output that.

going to close this as it doesn't look like it's an issue but feel free to keep commenting here if you still think there's a bug

@arturoc arturoc closed this as completed Apr 4, 2017
@bangnoise
Copy link
Contributor Author

That sucks.

That limitation is not expressed in the API or documentation. At minimum, this is a documentation issue and should be reopened and fixed as such. An error from ofSoundStream::setup() if attempting to create more than one stream for the same device would be useful too.

It's rather a severe limitation, and I don't see any technical reason for it. Your use-one-buffer solution won't work in my case, where I want to use it in an ofxAddon, so can't assume users don't have their own ofSoundStreams outside of mine.

Supporting audio output for multiple streams on macOS, Windows and Linux without ofSoundStream will require a large chunk of per-platform code - exactly the sort of thing that using OpenFrameworks should make easy. Perhaps this could be reopened as an enhancement and made to work at some point in the future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants