-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
There is a way to crash the application by calling ofSoundStream::stop(), after calling ofSounStream::start() atleast two times in a row.
If you call the ofSoundStream::start(), after the soundstream is alreading running, it displays a console message saying:
RtApiWasapi::startStream: The stream is already running
Wich in my eyes is the right response. but if you then try to stop it by calling ofSoundStream::stop()
it crashes. This is something I could reproduce everytime I tried it this way.
Here is the simple code I used and how I tested it.
void ofApp::setup(){
stream1.setup(this, 2, 0, 44100, 512, 4);
}
void ofApp::audioOut(float * buffer, int bufferSize, int nChannels)
{
for (int i = 0; i < bufferSize; i++) {
}
}
//--------------------------------------------------------------
void ofApp::keyPressed(int key){
switch (key)
{
case 's':
stream1.start();
break;
case 'p':
stream1.stop();
break;
default:
break;
}
}
If I press ‘p’ after Startup, the soundstream will stop without error.
From this point i can start it again, pressing ‘s’.
I can repeat this procedure over and over again without errors.
Until I press ‘s’ when the soundstream is already running. Then I get an console output: RtApiWasapi::startStream: The stream is already running.
If I now press ‘p’ again, it will crash.