-
Notifications
You must be signed in to change notification settings - Fork 30
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: Audio playing from other App does not return to full volume after finishing speaking #138
Comments
Would you be willing to create a PR? |
I think something like this could be the fix:
|
I have tested calling |
Great! Did you wrap that into a capacitor plugin, will you issue a PR?
…On Mon, Oct 21, 2024 at 6:53 AM flexiblefactory ***@***.***> wrote:
I have tested calling AVAudioSession.sharedInstance().setActive(false))
after the speech and confirmed that this is the fix to restore normal audio
volume to other applications
—
Reply to this email directly, view it on GitHub
<#138 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA45SGEYELMHEN563OVWLSDZ4T2NTAVCNFSM6AAAAABQIWETT6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRWGU4DSNJXHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
It is a plugin currently and works as a workaround. I do think it would make sense for the changes above to be integrated into the TTS plugin. |
I believe this approach may cause UI stuttering if setActive is called during a UI animation or, for instance, when a Camera Preview is active. Handling AVAudioSession on a background queue introduces a lag of approximately 300-500ms, varying based on the device. A more appropriate solution might be to provide explicit start or stop methods, allowing users to control when the audio session is activated or deactivated, avoiding these performance issues. This would give developers finer control over managing the audio session in relation to their app's lifecycle and UI elements. cc: @robingenz @Solarus8 |
The other aspect to this is that the plugin also sets active |
That's true. So, if setActive method is configurable from TS side then think it could fix all of these issues at once? |
Plugin version:
"@capacitor-community/text-to-speech": "^5.0.0"
Platform(s):
iPhone 15 Pro Max, iOS 18.0.1
Current behavior:
When playing other audio (music app - like Pandora) the volume of that audio does not return to full volume after it is attenuated during the text-2-speech content is finished playing
Expected behavior:
The audio of any other app will return to full volume after the text-2-speech content is finished playing.
Steps to reproduce:
Open Pandora (or other audio app), open capacitor app with text-2-speech, play text, notice volume is about halved when text is read (this is good) and then the volume of Pandora stays at halved volume until the app is sent to the background or closed.
The text was updated successfully, but these errors were encountered: