-
Notifications
You must be signed in to change notification settings - Fork 53
SimpleAudioPlayer: setting volume to 0 not working on iOS #95
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
Comments
In my limited testing, it looks like setting the volume has no effect on the player on iOS. When debugging, it always shows the value of the Volume property of the object as 1. As a workaround, I am using this code to pause execution for the time it would have played the clip silently:
|
I think this is most likely caused by #107. Try setting the volume after calling |
Thanks! That does seem to have fixed the issue for me. |
I have a Xamarin Forms app that I originally tested and released on Android, and am now testing and modifying as required for iOS. I use SimpleAudioPlayer as a simple way of playing audio clips (thanks!).
I need to be able to sometimes play an audio clip silently i.e. the app pauses playback from the user's point of view for the time of the audio clip's length. I do this on Android by simply setting the volume to 0, with code something like this:
if (audioToPlay.PlaySilenceFlag) { MyVolume = 0; PlayerSvc.player.Volume = MyVolume; }
This works fine on Android with the clip playing silently. On iOS, the clip plays at normal volume. My code around this is the same on both platforms. FYI my code sets the volume back to 1 in the playback ended event.
Are you aware of any issue setting volume to 0 on iOS? Or can you suggest a possible cause for this behaviour?
Thanks!
The text was updated successfully, but these errors were encountered: