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
[BUG]: Unreliable volume control #733
Comments
@tamoyal , I already saw a Problem Report (a long time ago) from someone else, having a problem with the volume setting. I would like to investigate your PR better. Unfortunately I am actually very busy and I have no much time. |
@tamoyal : Can you specify :
|
Note for FS developers : |
@Larpoux Added details! I have only tested on iOS / real device |
OK. I put your PR on top of the TODO stack. What are you playing back from ?
|
@Larpoux Thank you! A buffer (see this line in the example above |
Sorry, I did not see that you posted your code. |
@Larpoux I've tried both but either way, isn't it a bit strange? Maybe if setting volume doesn't actually work until the player is playing it should throw an exception (like setting volume would throw an exception if the player audio session wasn't is not open) |
Yes. I agree |
@tamoyal , I found where was the problem. I will publish a new release in a few days (I want to fix a few others things in this release and check that everything OK on Android and Web). |
Oh amazing, let me know if I can help test @Larpoux |
@Larpoux I have a question that is sorta related to this issue. One thing I'm noticing is there seems to be a conflict between this library and the speech to text plugin I mentioned above, on iOS. When the conflict occurs, that is one instance of this volume issue. I'm curious to see if your fix will handle that. Regardless, that led me to dig in deeper and I see that audio sessions on iOS are handled via a shared instance like |
@tamoyal ,
I suggest to release today or tomorrow, the fix for the |
Flutter Sound 8.2.2 is released. |
Sorry, 8.2.2 is bad |
@Larpoux No problem, I will test whenever you are ready. Thank you! |
OK. I coded a simple example that starts two Flutter Sound Players. |
Fixed in v8.2.5. Please re-open this issue if you have still problems with |
Hello Larpoux, Hope you've been well my friend. Sorry to drag this old issue open, but i am having the exact same issue as described above! Volume is almost inaudible on iOS, works perfectly fine on android, i even tried reinitialising each time i play a sound, with no luck as per OPs workaround. I also use flutter sound recorder, not sure if that is causing the issue. flutter_sound: ^9.2.13 I tried testing your volume example (https://github.com/Canardoux/flutter_sound/blob/master/flutter_sound/example/lib/volume_control/volume_control.dart) And it seems a little louder, but still not as loud as when i try another app, e.g. Youtube; I also noticed that it is mono, i.e. only uses the phone speaker, and not the speakers at the bottom of the phone.
|
@Larpoux never mind, i think i may have resolved it the same way you helped me resolve the play and record issue last time with setting audioSession config ha. Will do some further testing. |
Should anyone encounter my issue, i suspect that iOS physical devices were ducking all audio, running this once solved the issue for me, note, i only call this function on iOS and not android, as it caused issues for me on android:
Specifically this config fixed the issue:
Original credit to @Larpoux ;) |
Flutter Sound Version :
Severity
Pretty high! The plugin is not usable if we can't control the volume.
Platforms you faced the error
Describe the bug
There are several situations where the volume lowers and cannot be controlled via
setVolume
back to normal. One seems to be when wesetVolume
to a lower number, likesetVolume(0.5)
. If I do that, then set the volume back to 1.0 (setVolume(1.0)
), the sound does not change.Another situation that more reliably messes with the volume is if I use the mic. I am using this speech to text plugin and when I activate the mic, all further sounds from this plugin will be very low (almost inaudible), even if I reset the volume to 1.0. When I reinstatiate the player (like if I do that every single time I play an audio file), the issue does not occur. It is also worth noting that I have used 3 flutter audio plugins prior to this and none of them had this issue so I think something funky is going on and it's probably not an issue with the speech to text plugin. And probably worth noting that after looking through the code of the speech to text plugin, I can't find any area of code that messes with the play volume.
In my particular case, I am playing a local file. Like this:
The text was updated successfully, but these errors were encountered: