48khz on main output device vs 44.1khz on earphones #1966
-
Hello! The scenario is the following:
Frames per burst and frequency are taken from the calls of:
... and they are set during the onCreate phase of the app and are set like this:
My app is also instructed to output pcm audio at the specified sample rate. The problem arise when sample_rate value returned by the system is 48000hz (so oboe::DefaultStreamValues::SampleRate = 48000) BUT, when the earphones are connected, it seems they consuming audio at 44100hz resulting in a slowed down audio. How should i manage this scenario? It's not clear to me |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
PROPERTY_OUTPUT_SAMPLE_RATE is for a low latency stream on the device. To get the actual sample rate of a stream, please call getSampleRate() on a stream once it's opened. In your case, your bluetooth stream should return 44100 and your app should handle this according. |
Beta Was this translation helpful? Give feedback.
-
The PROPERTY_OUTPUT_SAMPLE_RATE Also oboe::DefaultStreamValues::SampleRate only affects the default rate for OpenSL ES, not AAudio. If you need a particular sample rate to match the rate of your content then you need to specify it directly:
|
Beta Was this translation helpful? Give feedback.
The PROPERTY_OUTPUT_SAMPLE_RATE
is not reliable. The actual default sample rate may be different on different peripheral or different stream settings.
Also oboe::DefaultStreamValues::SampleRate only affects the default rate for OpenSL ES, not AAudio.
If you need a particular sample rate to match the rate of your content then you need to specify it directly: