Skip to content

Commit

Permalink
ofSoundBuffer getChannel fix (#6117)
Browse files Browse the repository at this point in the history
ofSoundBuffer::checkSizeAndChannelsConsistency is crashing when calling ofSoundBuffer::getChannel with channels = 1
  • Loading branch information
leozimmerman authored and arturoc committed Nov 13, 2018
1 parent 9dd4249 commit 5a2cf1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/openFrameworks/sound/ofSoundBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ void ofSoundBuffer::getChannel(ofSoundBuffer & targetBuffer, std::size_t sourceC
targetBuffer.setNumChannels(1);
targetBuffer.setSampleRate(samplerate);
if(channels == 1){
copyTo(targetBuffer, getNumFrames(), 0, 0);
copyTo(targetBuffer, getNumFrames(), 1, 0);
}else{
// fetch samples from only one channel
targetBuffer.resize(getNumFrames());
Expand Down

0 comments on commit 5a2cf1e

Please sign in to comment.