-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General volume is lower than on the default libGDX implementation. #18
Comments
I tested this on music example and on my device there is no difference (or possibly I don't hear very well 😢). AFAIR there is nothing in Oboe itself that would create such effect, although there is an option that can indirectly cause that. On some android APIs there are different settings of audio volume per "usage group", and in libgdx-oboe, the usage group is As a workaround, I can implement a master volume just for |
A good point about the audio attributes! Audio attributes for the sound pool (all game sounds use it): if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
AudioAttributes audioAttrib = new AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_GAME)
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.build();
soundPool = new SoundPool.Builder()
.setAudioAttributes(audioAttrib)
.setMaxStreams(config.maxSimultaneousSounds)
.build();
} else {
soundPool = new SoundPool(config.maxSimultaneousSounds, AudioManager.STREAM_MUSIC, 0); // srcQuality: the sample-rate
// converter quality. Currently
// has no effect. Use 0 for the
// default.
}
manager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
if (context instanceof Activity) {
((Activity)context).setVolumeControlStream(AudioManager.STREAM_MUSIC);
} Music instance creation: protected MediaPlayer createMediaPlayer () {
MediaPlayer mediaPlayer = new MediaPlayer();
if (Build.VERSION.SDK_INT <= 21) {
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
} else {
mediaPlayer.setAudioAttributes(new AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
.setUsage(AudioAttributes.USAGE_GAME).build());
}
return mediaPlayer;
} I checked again the game with and without Oboe on my Pixel 3 (Android 12). I can't spot any difference in the sound slider or in the sound settings menu. It always changes the volume under the "Media volume" slider. And the perceived output volume is dramatically different under the same system's "Media volume" value for both sound effects and music. |
Oh. My thoughts on that is because I don't hear any difference on my device, it must be device specific, hence this issue is something with |
I think you're right about the device-specific nature of the case. I couldn't find any similar reports about Oboe anywhere and it doesn't seem like any of the emulators share the same problem. However, I have two Pixel 3 phones and they both have lower output volume with Anyway, it's not nearly a critical bug and it doesn't worth any more time spent investigating it. I'd suggest just keeping this issue open till there are more details available. Hopefully, someone else will notice the same behavior sometime soon. |
I noticed that if I disable Oboe in my project (comment
createAudio()
method in theAndroidApplication
class) the overall audio volume gets much louder (feels like twice as loud).I couldn't find any master volume parameter in Oboe classes. Is it possible that the master volume is locked to
0.5
by default somewhere down deep in the native code?The text was updated successfully, but these errors were encountered: