mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Android: Allow less common sample rates.
Just assume anything we received is a valid one.
This commit is contained in:
parent
737be61f9a
commit
812e84e4a7
1 changed files with 2 additions and 8 deletions
|
@ -23,10 +23,6 @@ AudioContext::AudioContext(AndroidAudioCallback cb, int _FramesPerBuffer, int _S
|
|||
framesPerBuffer = 4096;
|
||||
|
||||
sampleRate = _SampleRate;
|
||||
if (sampleRate != 44100 && sampleRate != 48000) {
|
||||
ELOG("Invalid sample rate %i - choosing 44100", sampleRate);
|
||||
sampleRate = 44100;
|
||||
}
|
||||
}
|
||||
|
||||
// This callback handler is called every time a buffer finishes playing.
|
||||
|
@ -84,10 +80,8 @@ bool OpenSLContext::Init() {
|
|||
result = (*outputMixObject)->Realize(outputMixObject, SL_BOOLEAN_FALSE);
|
||||
assert(SL_RESULT_SUCCESS == result);
|
||||
|
||||
SLuint32 sr = SL_SAMPLINGRATE_44_1;
|
||||
if (sampleRate == 48000) {
|
||||
sr = SL_SAMPLINGRATE_48;
|
||||
} // Don't allow any other sample rates.
|
||||
// The constants, such as SL_SAMPLINGRATE_44_1, are just 44100000.
|
||||
SLuint32 sr = (SLuint32)sampleRate * 1000;
|
||||
|
||||
SLDataLocator_AndroidSimpleBufferQueue loc_bufq = {SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE, 2};
|
||||
SLDataFormat_PCM format_pcm = {
|
||||
|
|
Loading…
Add table
Reference in a new issue