oboe
oboe copied to clipboard
equalizer not work
in java MainActivity
AudioManager audioManager = (AudioManager) getApplicationContext().getSystemService(Context.AUDIO_SERVICE); int audioSessionId = audioManager.generateAudioSessionId(); LiveEffectEngine.setSessionId(audioSessionId); eq=new Equalizer(0,audioSessionId);
in jni
JNIEXPORT void JNICALL Java_com_google_sample_oboe_liveEffect_LiveEffectEngine_setSessionId( JNIEnv *env, jclass, jint sessionId) { if (engine == nullptr) { LOGE( "Engine dasdas must call createEngine before calling this " "method"); return; } engine->setSessionId(sessionId); }
void LiveEffectEngine::setSessionId(int32_t sessionId) { mSessionId = static_castoboe::SessionId(sessionId); }
and I call
inBuilder.setSessionId(mSessionId);
but it always nothing change,please help
Are you actually changing the Equalizer settings? What are you expecting to hear?
Here is an example of changing the knobs in OboeTester:
https://github.com/google/oboe/blob/d008ab660a9059a1b69ae870f853afd2d8e0cd0e/apps/OboeTester/app/src/main/java/com/google/sample/oboe/manualtest/TestOutputActivityBase.java#L66
您實際上是在更改
Equalizer設置嗎?您希望聽到什麼?
`short maxEQLevel = eq.getBandLevelRange()[1];
int num_bands = eq.getNumberOfBands();
for (int i = 0; i < num_bands; i++) {
eq.setBandLevel((short) i, (short) maxEQLevel);
}
eq.setEnabled(true);`
I turned all the bands to maximum
and when I call
outBuilder.setSessionId(oboe::SessionId::Allocate);
and
outBuilder.getSessionId();
It's always return 0
這是在OboeTester中更改旋鈕的示例:
https://github.com/google/oboe/blob/d008ab660a9059a1b69ae870f853afd2d8e0cd0e/apps/OboeTester/app/src/main/java/com/google/sample/oboe/manualtest/TestOutputActivityBase.java#L66
After testing, either setting the equalizer SessionId to the same as oboe or directly using SessionId = 0 it's all not work.
oboe::SessionId::Allocate is defined as 0. The ID will allocated when you create the stream. try stream->getSessionId();
I turned all the bands to maximum
That will just make the sound louder. Try setting the turning all the bands down low except for one band set high. Then you may hear a difference in the spectrum.
oboe :: SessionId :: Allocate定義為0。 創建流時將分配ID。 嘗試stream-> getSessionId();
我把所有樂隊調到最大
那隻會使聲音更大聲。嘗試將所有頻段調低,除非將一個頻段設置為高。然後您可能會聽到頻譜差異。
In the LiveEffect example I added the following code to openStreams
LOGD("mPlayStream %d",mPlayStream->getSessionId());
But I get -1.
The simulator works normally after testing ,but my device can't. My device is SM-G930F and I flash third party ROM to android pie
Thank you for such a quick reply.
Try this in OboeTester: Tap TEST OUTPUT Check the box for "Effect" Tap OPEN and START
You should see a non-zero number next to the Effect checkbox. That is the Session ID.
I flash third party ROM to android pie
Then there is no way of knowing that changes they made or what they broke. I don't think we can support you on that device. Do you have a device with an official factory ROM?
Closing since this is a custom ROM