Comments (26)
Can you try the latest commit? In your pubspec.yaml
use the following dependency override:
dependency_overrides:
audio_session:
git:
url: https://github.com/ryanheise/audio_session.git
from audio_session.
Great! Thanks for helping to test this. I'll put out a new release now.
from audio_session.
The fix has now been published as release 0.1.1
.
Note, the next release will probably be 0.2.0
which will move to the new rxdart
.
from audio_session.
I fixed this issue replacing this package with assets_audio_player. Thank you for your support! I will let this issue open in case @paurakhsharma wants to continue with this package.
from audio_session.
Yes, please do leave it open until the issue is resolved.
from audio_session.
The problem could be in one of 3 places.
Was there a change in your audio_session version, or a change in audioplayers, or a change in your code?
from audio_session.
@ryanheise I updated audio_session and audioplayers to the latest version. Code not changed.
from audio_session.
Are you able to downgrade audio_session and test?
from audio_session.
I tried to change 0.1.0 with 0.1.0-nullsafety.0 but is the same thing. If I downgrade to 0.0.11 and I run pub get I get this:
Because flutter_cache_manager >=3.0.2 depends on rxdart >=0.26.0 <0.28.0 and flutter_cache_manager >=3.0.0-nullsafety.1 <3.0.2 depends on rxdart ^0.26.0, flutter_cache_manager >=3.0.0-nullsafety.1 requires rxdart >=0.26.0 <0.28.0.
And because cached_network_image >=3.0.0 depends on flutter_cache_manager ^3.0.0 and audio_session >=0.0.10 <0.1.0-nullsafety.0 depends on rxdart >=0.24.1 <0.26.0, cached_network_image >=3.0.0 is incompatible with audio_session >=0.0.10 <0.1.0-nullsafety.0.
So, because bestill depends on both audio_session ^0.0.11 and cached_network_image ^3.0.0, version solving failed.
pub get failed (1; So, because bestill depends on both audio_session ^0.0.11 and cached_network_image ^3.0.0, version solving failed.)
Also, I tried to downgrade audioplayers to 0.18.0 (first release with stable null safety) and nothing.
I do not know if it helps but when audio is interrupted with an audio from system I get this in my console (also, after the audio from system is done):
routeChange detected
audioInterrupt
from audio_session.
There were not any major differences between 0.1.0 and the 0.1.0-nullsafety.0 prerelease, so I assume 0.0.11 or earlier was the last version you tried that worked.
Can you test audio_session 0.0.11 and keep everything else unchanged (use your current app code and your current version of audioplayers) and force the above error to disappear using dependency_overrides?
So in particular, can you use a dependency override on rxdart
to depend on the newer version of rxdart?
from audio_session.
@ryanheise I did it and it's working (with unsound null safety). So what should I do? I need a null safety version tho so I can release my app to beta testers and after this for production.
from audio_session.
I'd like to fix it (with your cooperation if you can), are you able to provide a minimal reproduction project that I can clone and run? E.g. By modifying the example to reproduce the bug?
from audio_session.
@ryanheise I tried with exemple from this package. You can look at this https://github.com/BringTheChill/example. It's working just on Android not on iOS. (in my project is not working on android either)
from audio_session.
Can confirm, We upgraded from version audio_session: ^0.0.11
to audio_session: ^0.1.0
and facing same issue on iOS.
from audio_session.
Thank you for the reproduction project. Just to confirm if I understand correctly, your example works if I downgrade the dependencies? What specifically were you testing as the source of the audio interruptions?
from audio_session.
your example works if I downgrade the dependencies?
yes
What specifically were you testing as the source of the audio interruptions?
Siri voice (I hope I understood your question)
from audio_session.
What specifically were you testing as the source of the audio interruptions?
Spotify, just as #27
from audio_session.
This is quite puzzling. I have compared the diffs between 0.0.11 and 0.1.0 and the logic is pretty much the same.
May I ask if you are seeing this log message appear from the objective C code?
NSLog(@"audioInterrupt");
Objective C logs might not appear in the usual Flutter console, so you may need to run this through Xcode to see it.
If that log is happening, then at least we know the even is being received on the platform side and is just getting lost in communication to the Flutter side.
from audio_session.
I use the session config for speech
with
session.configure(AudioSessionConfiguration.speech())
These are the logs I see:
-
In vscode
i) When Spotify takes the focus of the audioaudioInterrupt
log is displayed in vscode console. My audio player is still playing but is ducked and cannot be heard.
ii) When I pause Spotify I get the logrouteChange detected
and thenaudioInterrupt
. Myaudio player doesn't get the volume back (i.e it is playing but cannot be heard) -
In Xcode
Same output. Same result.
Hope it helps.
from audio_session.
This is quite puzzling. I have compared the diffs between 0.0.11 and 0.1.0 and the logic is pretty much the same.
May I ask if you are seeing this log message appear from the objective C code?
NSLog(@"audioInterrupt");Objective C logs might not appear in the usual Flutter console, so you may need to run this through Xcode to see it.
If that log is happening, then at least we know the even is being received on the platform side and is just getting lost in communication to the Flutter side.
@ryanheise yes I got "audioInterrupt" on my console. I said this in a comment above too.
from audio_session.
Ah, yes I missed that you mentioned that. This is I suppose good news because it means the event is being detected at the low levels and it's just failing to make its way up to the higher levels.
There is an intermediate level in the AVAudioSession
class. If you listen to the interruption stream directly from this class, do you receive the notifications? i.e.
AVAudioSession().interruptionNotificationStream.listen((note) {
print('received interrupt');
print('type: ${note.type}');
print('wasSuspended: ${note.wasSuspended}');
});
from audio_session.
@ryanheise
We inserted the hooks after audio_session initialization.
final session = await AudioSession.instance;
await session.configure(AudioSessionConfiguration.speech());
AVAudioSession().interruptionNotificationStream.listen((note) {
print('received interrupt');
print('type: ${note.type}');
print('wasSuspended: ${note.wasSuspended}');
});
We even closed the app and re-run it after making this change.
But we couldn't see this log output.
Here is the log we got instead:
When the audio player starts
routeChange detected
When I open and play Spotify
audioInterrupt
When I pause Spotify
routeChange detected
audioInterrupt
When I go back to the app
dnssd_clientstub read_all(11) DEFUNCT
[VERBOSE-2:FlutterObservatoryPublisher.mm(143)] Could not register as server for FlutterObservatoryPublisher. Check your network settings and relaunch the application.
dnssd_clientstub read_all(20) DEFUNCT
[VERBOSE-2:FlutterObservatoryPublisher.mm(143)] Could not register as server for FlutterObservatoryPublisher. Check your network settings and relaunch the application.
dnssd_clientstub read_all(31) DEFUNCT
[VERBOSE-2:FlutterObservatoryPublisher.mm(143)] Could not register as server for FlutterObservatoryPublisher. Check your network settings and relaunch the application.
dnssd_clientstub read_all(33) DEFUNCT
[VERBOSE-2:FlutterObservatoryPublisher.mm(143)] Could not register as server for FlutterObservatoryPublisher. Check your network settings and relaunch the application.
BackgroundSession <13A7D914-C21A-43B1-AB9D-E60C4C437399> connection to background transfer daemon interrupted
BackgroundSession <13A7D914-C21A-43B1-AB9D-E60C4C437399> connection to background transfer daemon invalidated
BackgroundSession <FD822123-5BED-435D-ADE3-DEE72D3E996D> connection to background transfer daemon interrupted
BackgroundSession <FD822123-5BED-435D-ADE3-DEE72D3E996D> connection to background transfer daemon invalidated
BackgroundSession <B6674567-56BF-48E1-89F9-FC4EFFB3CDC1> connection to background transfer daemon interrupted
BackgroundSession <B6674567-56BF-48E1-89F9-FC4EFFB3CDC1> connection to background transfer daemon invalidated
from audio_session.
OK, I think I may see the issue. Let me try a fix.
from audio_session.
Thanks, @ryanheise will let you know shortly.
from audio_session.
@ryanheise Can confirm this is fixed for me. Thank you so much 🎉 🚀
from audio_session.
Thank you for putting your time and effort to make our life easier 🙂
from audio_session.
Related Issues (20)
- Add privacy manifest for Apple HOT 6
- [iOS] Background audio not playing on iPhone 13+ HOT 3
- AVAudioSessionCategoryOptions.mixWithOthers stops background music the first time when audio is player, after continuing the music further sounds no longer stop the music HOT 1
- Call requires API level 23 (current min is 16) HOT 1
- Can not play by speaker on iOS HOT 3
- Is it possible to play audio when Do Not Disturb mode is on, but not in silent mode? HOT 1
- `AVAudioSessionCategoryOptions`'s `contains` method takes `AVAudioSessionInterruptionOptions`. Maybe it should be `AVAudioSessionCategoryOptions`? HOT 5
- Dependency causing an ANR in the Background HOT 3
- The music played by IOS17 is not output from Bluetooth earphones HOT 2
- Android detects the headset as if it is connected even if it is not HOT 1
- Trouble closing an audio session HOT 1
- Echo cancellation HOT 3
- Can't get current audio device HOT 1
- failed for task ':audio_session:compileReleaseJavaWithJavac' (target SDK 33) HOT 1
- AudioSessionConfiguration with multiple categories causes PlatformException(-50)
- Execution failed for task ':audio_session:compileDebugJavaWithJavac'
- [Question] Can audio playback be started while app is in the background in IOS? HOT 1
- file or directory '/home/user/.pub-cache/hosted/pub.dev/audio_session-0.1.19/android/src/debug/java', not found
- java issue to even run the project
- Notification stays open HOT 2
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 audio_session.