mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-06 06:54:29 +00:00
Fixes Issue #110: playback speed wrong. Turns out the channel count
wasn't always being properly propagated through the system.
This commit is contained in:
parent
3d6a3d93e0
commit
7b924477c8
@ -181,6 +181,7 @@ bool Stream::GetNextBufferFromDecoder() {
|
||||
for (int i = 0; i < bufferCount; i++) {
|
||||
auto buffer = new Buffer(this->rawBuffer + offset, samplesPerBuffer);
|
||||
buffer->SetSampleRate(this->decoderSampleRate);
|
||||
buffer->SetChannels(this->decoderChannels);
|
||||
this->recycledBuffers.push_back(buffer);
|
||||
offset += samplesPerBuffer;
|
||||
}
|
||||
|
@ -113,8 +113,10 @@ bool NomadDecoder::GetBuffer(IBuffer *buffer) {
|
||||
DEFAULT_READ_SAMPLE_SIZE,
|
||||
SAMPLE_FORMAT_32_BIT_FLOAT);
|
||||
|
||||
auto info = nomad_info(this->nomadContext);
|
||||
buffer->SetChannels(info->channels);
|
||||
buffer->SetSamples(read > 0 ? read : 0);
|
||||
buffer->SetSampleRate(nomad_info(this->nomadContext)->sample_rate);
|
||||
buffer->SetSampleRate(info->sample_rate);
|
||||
|
||||
return (read > 0) ? true : false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user