doublesymmetry / react-native-track-player

A fully fledged audio module created for music apps. Provides audio playback, external media controls, background mode and more!
https://rntp.dev/
Apache License 2.0
3.32k stars 1.02k forks source link

[Feature Request] Channel splitting and merging with volume control. #2297

Closed 7ammer closed 4 months ago

7ammer commented 7 months ago

What is the need and use case of this feature? I have a scenario where by the audio player needs be able to adjust the audio volume for music and narration separately.

Describe the ideal solution A way to achieve this could be by having one file with two channels. One channel as the audio and the other channel as the narration. Some sort of API could then split those two channels, adjust the gain for each as needed and then merge the split channels to both channels to create, in effect, one mono channel.

The Web Audio API allows for this kind of thing and would be ideal. The createChannelSplitter and createChannelMerger are key.

I am not sure what the Android and iOS API's provide and if such a thing is possible with these API's. Is it: KotlinAudio and SwiftAudioEx?

Describe alternatives you've considered The ability to stream two media files at the same time. This is complicated due to trying to keep the to files in sync. It feels very error prone.

How I can Help I'd like to help but I'm not sure how useful I'd be.

lovegaoshi commented 7 months ago

i believe your best bet is expo-AV and use 2 instances of them, and update both instances simutaneously on seek/next/previous, etc. RNTP wont support playing multiple files (notification will simply not work) and the channel splitting seems not supported by exoplayer at least. if u happen to find code snippets perhaps someone bored enough will migrate over

github-actions[bot] commented 4 months ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 4 months ago

This issue was closed because it has been stalled for 7 days with no activity.