1

我有 Pixel 2XL,这个设备有 2 个扬声器,一个在顶部,一个在底部。

所以,对于声音播放,我使用双簧管库

https://github.com/google/oboe/tree/master/samples/hello-oboe

但我注意到声音仅从顶部的一个扬声器播放。

但例如,PlayMarket 上有一个应用程序 - SoundCloud,如果我尝试从该应用程序播放某些内容,我会听到声音从顶部和底部的两个扬声器发出。

所以,我假设应该在双簧管库上有一个设置,以便设置我需要如何从哪个扬声器播放声音等等。

但我没有找到任何关于它的信息。

怎么做?

4

1 回答 1

1

The channelCount is set on the builder using setChannelCount(cc) https://github.com/google/oboe/blob/d27324865282e8d8497bdc6652df98d3f2f0f6c7/samples/hello-oboe/src/main/cpp/HelloOboeEngine.cpp#L93

You cannot direct the sound to specific speakers. The routing is determined by the phone.

I tried Hello-Oboe on a Pixel 2 XL. If I cover the top speaker with my thumb then the sound definitely changes. So it is playing through the top speaker on my device.

Perhaps some app let the phone in a state where it is treating the top speaker as an earpiece. Try rebooting the phone. Does it now sound louder in the top speaker?

于 2020-05-21T17:55:29.030 回答