-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
negative interaction with audio_session #104
Comments
Hey @lukepighetti, I read ryanheise reply. Unfortunately, I don't have a Mac to try. What I can say is that In the
Also, have you tried to load the asset before calling |
I’m also experiencing issues with SoLoud’s interaction with audio_session, although I haven’t experienced the same issue as @lukepighetti. It seems that the way SoLoud is handling interruptions internally could be interfering with attempts to use audio_session. I made a quick example app that highlights the issue on iOS. The app uses one AudioSession instance with the exact same implementation for just_audio and SoLoud. RPReplay_Final1721036954.movYou can see from the video:
Ideally, SoLoud would leave all interruption logic to be handled in audio_session, which would allow for one centralized place for session logic and handling of more complex scenarios. I’ve been using the main branch as suggested by @alnitak, and also tried using a local fork of SoLoud, commenting out some of the interruption logic I could find like |
Hi @sbauly, thank you very much for your findings and your time. This seems related to #86. When I tried to look at this, the only notifications I saw were the I'll try to look at this issue again even if I cannot try it on iOS. Do you mind sharing your "quick example"? |
Thanks for your speedy reply @alnitak! Regarding #86 I’ve found that mixing sounds is possible by using the audio_session package and setting The problem I’ve found is pausing/resuming SoLoud when an interruption event occurs. Android allows multiple audio sessions so it isn’t causing problems there, but on iOS I suspect that some of the I have published the example app here, hopefully it can be helpful |
you just need to set AVAudioSessionCategoryAmbient if (![pAudioSession setCategory:AVAudioSessionCategoryAmbient withOptions:options error:nil]) {
return MA_INVALID_OPERATION; /* Failed to set session category to Ambient. */
}
if (!pConfig->coreaudio.noAudioSessionActivate) {
if (![pAudioSession setActive:true error:nil]) {
ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "Failed to activate audio session.");
return MA_FAILED_TO_INIT_BACKEND;
}
} |
Hi @ABespolov , thanks for the suggestion. Could you elaborate on this issue? I've tried setting the The only solution I have found so far is to re-initialize SoLoud after each interruption event. In the example app I published, the just_audio and SoLoud implementations use the exact same audio_session configuration, yet only SoLoud has an issue, which has lead me to believe this is a SoLoud specific issue, rather than a problem with the audio_session configuration I have been using. |
ryanheise/audio_session#138
The text was updated successfully, but these errors were encountered: