Remove IAudioRenderer::testAudio() and just use IAudioRenderer::prepareForPlayback() instead

This commit is contained in:
Cameron Gutman
2018-10-01 19:49:08 -07:00
parent 209b4a1b02
commit 8dddcd04d5
6 changed files with 19 additions and 109 deletions

View File

@@ -27,7 +27,25 @@ bool Session::testAudio(int audioConfiguration)
return false;
}
bool ret = audioRenderer->testAudio(audioConfiguration);
// Build a fake OPUS_MULTISTREAM_CONFIGURATION to give
// the renderer the channel count and sample rate.
OPUS_MULTISTREAM_CONFIGURATION opusConfig = {};
opusConfig.sampleRate = 48000;
switch (audioConfiguration)
{
case AUDIO_CONFIGURATION_STEREO:
opusConfig.channelCount = 2;
break;
case AUDIO_CONFIGURATION_51_SURROUND:
opusConfig.channelCount = 6;
break;
default:
SDL_assert(false);
return false;
}
bool ret = audioRenderer->prepareForPlayback(&opusConfig);
delete audioRenderer;