audioplayers icon indicating copy to clipboard operation
audioplayers copied to clipboard

Spatial or Stereo Control for audio

Open pooyakhosravi opened this issue 5 years ago • 8 comments

Suggestion: to add a function to audioplayer to be able to control the balance of sound (left vs right) with simple values from -1 (left) to 1 (right). Where is the correct place to look to add the changes?

  • [x] Linux
  • [x] Windows
  • [x] Android
  • [x] Web
  • [ ] iOS
  • [ ] macOS

pooyakhosravi avatar Nov 02 '18 07:11 pooyakhosravi

Hi, @pooyakhosravi

That's a great suggestion! Would make a nice addition! Would you like to contribute with a PR? It'd be awesome! :)

luanpotter avatar Nov 02 '18 13:11 luanpotter

Sorry, I forgot to address your second question! Where is the correct place to look to add the changes? Well, I don't know exactly how to implement this natively on either platform, but the changes would be on:

  • lib/audioplayers.dart file, add a new method setRightBalance or something that takes the integer and send it to the native counterpart.
  • android/src/main/java/xyz/luan/audioplayers/AudioplayersPlugin.java for the implementation on the android side, upon receiving the message. Might need to change inside WrappedPlayer, depending whether this is state-dependent relating to the complex android's audio player's state flowchart hell.
  • ios/Classes/AudioplayersPlugin.m file for the ios implementation (this tends to be simpler).

If you have more questions regarding implementation, please let me know.

Again, sorry for not answering half your question, I was skimming fast through the issues and missed the end.

luanpotter avatar Nov 24 '18 10:11 luanpotter

Hi, added stereo balance control for Windows. Also tried to add for Linux, but can't make it to work. Maybe somebody can help with Linux support?

novikov-studio avatar Aug 13 '22 16:08 novikov-studio

Sorry, web, darwin and android are still missing...

Gustl22 avatar Sep 23 '22 15:09 Gustl22

So is someone working on iOS/macOS support for this or I could look into it? Not sure if I could but no harm in trying.

emperor-limitless avatar Jun 24 '23 08:06 emperor-limitless

@mohamedSulaimanAlmarzooqi go ahead, we're always open to PRs! :)

spydon avatar Jun 25 '23 14:06 spydon

is this working on IOS already?

dawsmith06 avatar Jul 11 '23 19:07 dawsmith06

@dawsmith06 , seems this is not the case at the moment, we are happy about any contributions :)

Gustl22 avatar Jul 23 '23 18:07 Gustl22