Skip to content

Add stereo balance / pan control (left–right channel volume) #1561

Description

@sagarchaulagai

Is your feature request related to a problem? Please describe.
I'm building an audio playback app (like an audiobook or music player) using just_audio.
Currently, there is no way to adjust stereo balance (left/right channel volume) in the playback.
This becomes an issue for:

  • users who want to correct imbalance between their left and right headphones,
  • accessibility cases (users with partial hearing loss in one ear),
  • or creative uses like panning and spatial effects.

At present, setVolume() only changes the overall loudness, not the left/right ratio.


Describe the solution you'd like
Add an API to control stereo balance (pan), similar to:

/// Sets stereo balance for playback
/// Range: -1.0 (left only) → 0.0 (center) → 1.0 (right only)
Future<void> setBalance(double balance){

ExampleI

    await player.setBalance(-0.5); // Slightly pan to the left
    await player.setBalance(0.8);  // Mostly pan to the right

Possible platform mappings:
In android, it is mentioned here : google/ExoPlayer#2659 (comment)
an existing audio processor called ChannelMappingAudioProcessor, which would address the use case of taking stereo and replacing one channel with the other.

In IOS and MAC, setting AVAudioPlayerNode().pan , where -1.0:represents full left panning, 0.0 represents centre and
1.0 represents full right panning.

In Web : using StereoPannerNode https://developer.mozilla.org/en-US/docs/Web/API/StereoPannerNode


Describe alternatives you've considered

I really donot know any alternatives.


Additional context

This feature would improve accessibility (for users with hearing imbalance) and enable creative use cases (music, games, sound effects, or immersive playback).
it should be technically feasible to implement this feature natively and expose it through a Dart method like setBalance() or setPan().

I’d be happy to help with testing or provide example implementations if needed.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions