Skip to content

Commit

Permalink
Auto-adjust sampling rates in MixStream.
Browse files Browse the repository at this point in the history
  • Loading branch information
stump committed Dec 26, 2012
1 parent 9fc5a40 commit bf50820
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/MixStreamCore.c
Expand Up @@ -93,6 +93,13 @@ MixStream* mix_stream_new(int samprate, int channels, mix_stream_read_cb read_cb
default: g_assert_not_reached(); break;
}

if (stream->samprate != stream->out_freq) {
stream->soundtouch = soundtouch_new();
soundtouch_set_sample_rate(stream->soundtouch, stream->samprate);
soundtouch_set_channels(stream->soundtouch, stream->channels);
soundtouch_set_rate(stream->soundtouch, (float)stream->samprate/(float)stream->out_freq);
}

return stream;
}

Expand Down

0 comments on commit bf50820

Please sign in to comment.