androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.59k stars 377 forks source link

How to set audio panning / balance / right left volume ? #310

Open Gustl22 opened 1 year ago

Gustl22 commented 1 year ago

I already searched the issues here, and in exoplayer repo.

Is there a way to set the right and left audio volume of a player. Or set balance or panning? Thx :)

andrewlewis commented 1 year ago

Not as a player API method, but this is possible to do via an audio processor - see https://github.com/google/ExoPlayer/issues/2659. We've submitted a ChannelMixingAudioProcessor that supports this internally and it will be on the main branch over the next few weeks, and should then go into the media3 1.1 release.

Gustl22 commented 6 months ago

@andrewlewis is there any accessible way to set audio pan on the fly, see https://github.com/androidx/media/issues/797. I attempted this in this PR but I only got it working to set at the beginning, not on the fly.

andrewlewis commented 6 months ago

It isn't supported directly, but in theory I think it should be possible to get your PR to work.

I haven't looked into this recently, but at a high level the important things are:

If it still doesn't work, could you add some logging to see what matrix is being used in queueInput and make sure it's changing after you set a new matrix?