floatinghotpot / cordova-plugin-nativeaudio

The low latency audio plugin is designed to enable low latency and polyphonic audio from Cordova/PhoneGap applications, using a very simple and basic API.
MIT License
235 stars 288 forks source link

Sound muted in standby #33

Open nimo862 opened 9 years ago

nimo862 commented 9 years ago

Hi, I noticed that the sound stops to play when the phone goes in standby mode, or also when - on android - the home button is pressed. Is it possible to fix this, and have the sound playing also in standby?

Thanks

floatinghotpot commented 9 years ago

The behavior was intensionally designed, stop playing audio when app go to background.

What's your use case for the requirement?

nimo862 commented 9 years ago

I'm developing an app to play guided meditations. I need to use this library because I must play in background a mix of different loops containing relaxing sounds, like beach waves, birds, wind, chimes, etc.

kaansoral commented 9 years ago

Apart from cordova, iOS sound logic is already pretty complicated and not well documented in my opinion, you might achieve what you want by manually editing the plugin and modifying the AVAudioSession

calebeaires commented 9 years ago

+1 Same here. Maybe if you create some options to turn of the onPause event.

eworker2003 commented 8 years ago

+1 for new feature (keep playing sound if app is inactive)!

iliasbhal commented 8 years ago

+1 for new feature (keep playing sound if app is inactive)!

Neotrixsx commented 8 years ago

+1 for new feature (keep playing sound if app is inactive)!

XaviGriso commented 8 years ago

+1 for new feature (keep playing sound if app is inactive)!