csdcorp / speech_to_text

A Flutter plugin that exposes device specific text to speech recognition capability.
BSD 3-Clause "New" or "Revised" License
351 stars 218 forks source link

Optionally play sounds on iOS #426

Closed cgutierr-zgz closed 9 months ago

cgutierr-zgz commented 9 months ago

I see that we have the option to optionally add sounds files for iOS that will automatically play

But if we add said assets we cannot make this optional

I would like to be able to have a toggle in the app that allows switching sound effects on and off, and for that, I should be able to have a method in the plugin

I think this is only available on iOS, but if it was possible in other platforms might make sense to add it too

sowens-csd commented 9 months ago

On Android the sounds cannot be disabled, they are played by the OS and there is no option to disable them.

For iOS if you want to toggle the sounds then I'd recommend not including the default assets for those sounds so that the plugin doesn't play them. Then add sound playback to your app and have it control playing the desired sounds.

cgutierr-zgz commented 9 months ago

Yeah I implemented it that way, but I thought It might be a good improvement, but no problem 😊