Skip to content
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

Low Volume #110

Open
joshs85 opened this issue Feb 2, 2025 · 2 comments
Open

Low Volume #110

joshs85 opened this issue Feb 2, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@joshs85
Copy link

joshs85 commented Feb 2, 2025

Describe the feature you'd like
An environment variable to set the output volume level. The volume seems low on the output files.

@remsky remsky added the enhancement New feature or request label Feb 2, 2025
@working-name
Copy link

working-name commented Feb 2, 2025

I have no idea how any of this works, fiddled with the normalizer and whatever methods are documented without any results (audio sounds the same). You can however multiply chunk_audio (ndarray) by whatever gain ratio you want in generate_audio_stream() of tts_service.py. Not a good solution, since some intonations will raise volume above expected and it will clip.

                        customgain = 1.6 # good base gain for all voices
                        twopoint5 = ['af_sky'] # particularly low volume voice
                        twopoint4 = ['af_bella'] # almost as low
                        onepoint9 = ['af_sarah_af_sky'] # not as bad, but there was room past 1.6
                        if voice in twopoint5:
                            customgain = 2.5
                        if voice in twopoint4:
                            customgain = 2.4
                        if voice in onepoint9:
                            customgain = 1.9
...
chunk_bytes = AudioService.convert_audio(
                            chunk_audio * customgain, # this is where I added it
                            24000,
...

An update was released for kokoro with more voices but not sure if volume has also changed.

@joshs85
Copy link
Author

joshs85 commented Feb 2, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants