Comments (8)
That's default behavior of iOS apps.
I was trying to mimic the Android SoundPool API on iOS but iOS application have a single AVAudioSession active and there is no such thing as stream types from Android.
If you want your app to allow background music to not be silenced by your app you need to change the AVAudioSession's category according to this guide.
from soundpool.
Changing the AVAudioSession's category works as expected.
Thank you!
from soundpool.
@ahaboubi I have the same problem. Can provide the code changes that you have done to make it work?
from soundpool.
@ahaboubi @deniza
I'm not sure I understand the solution "AVAudioSession" you mentioned above. If the music app was my designed app, I agree that I can set AVAudioSession something like mixWithOthers in the music app but it's not mine. Or are you meaning to set AVAudioSession mode in SoundPool? how? Could you share more how you fix it? thanks in advance!
from soundpool.
@JmyW I also was not able to fix it with AVAudioSession. So I have switched to the library audioplayers which does not have this problem.
from soundpool.
audioplayers library does exactly that: it updates the AVAudioSession config when it is going to play notification sound or something similar. It has way more features (it can also can use Soundpool on Android) but this plugin is focused on simplicity and short sound effects management.
from soundpool.
@JmyW Thats the native code you should add somewhere applicable in your ios project. (Runner.xcodeproj)
Personally I put it into some custom plugin function, but I think that you can safely call it from didFinishLaunchingWithOptions in AppDelegate.swift. Also remember to import AVFoundation
from soundpool.
@deniza @denniske Got it. thanks for let me know. However just for your reference, I've known some others like audioplayers that support mode "respectSilence" set true during initiation to enable the co-existence with background music. That maybe an idea make this package stronger.
To be honest, I tend to use soundpool rather than audioplayers since I am not designed a "players" but an application. And I'm actually seeing audioplayers' issue when special situation in my code, that's why I'm searching better & tiny solution like soundpool.
from soundpool.
Related Issues (20)
- Catch when the sound is completed. HOT 1
- Question about `load` HOT 2
- Soundpool Audio Not Heard When Running on Mobile Device's Chrome Web Browser
- Admob interstitial ads are silent after they are displayed.
- Package Upgrade issue HOT 3
- Could not find method namesapce() for arguments [pl.ukaszapps.soundpool] on extension 'android' of type com.android.build.gradle.LibraryExtension.
- stop() not working with loadAndPlayUri and loadAndPlayUint8List HOT 2
- setVolume resets to default 1.0 when maxStreams > 1
- Namespace not specified. Specify a namespace in the module's build file HOT 3
- Soundpool Plugin Causing Crash on Flutter iOS App HOT 3
- soundpool_windux is incompatible with soundpool_web due to http version dependency HOT 1
- soundpool.play returned streamId==0 HOT 4
- Windux: setVolume throws UnimplementedError although it has been implemented in Rust.
- Initial sound playback defaults to volume 1.0 regardless of set value HOT 1
- Feature Request: Pitch Adjustment for Soundpool HOT 1
- iOS - .play() works only the first time HOT 2
- Raster Jank HOT 1
- Playing sound stops background music on Android HOT 3
- 'Soundpool.new' is deprecated and shouldn't be used. Use fromOptions instead.
- 16 Warning Message when Building Signed APK
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from soundpool.