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

Increase maximum volume for TTS output #26

Open
ClemensGruber opened this issue Feb 15, 2024 · 1 comment
Open

Increase maximum volume for TTS output #26

ClemensGruber opened this issue Feb 15, 2024 · 1 comment
Labels
bug Something isn't working enhancement-raspi New feature or request RasPi

Comments

@ClemensGruber
Copy link
Owner

We did some tests in loud environment and noticed a too low volume with the Anker PowerConf S330 USB conference system, even with volume control of the speaker on max position. While playing a seconde sound file we noticed that the parallel played second file was much louder than the voice of GPTree and so global system / speaker volume seems not to be the limitation. The speaker can output loud sound!

1. Check if the used software player could be the problem:

  • For the second file we used ffplay as software player.
  • For the first (GPTree) file we used os.system(f"afplay {filename_output}")
  • Check if there is a volume parameter in ffplay vs. afplay what could cause the difference

2. Check if the encoded file has to less volume

  • Perhaps the TTS created voice is too quiet and we have to increase the volume on this side.
  • There are some indicators that this is possible, see the Google TTS API documentation https://cloud.google.com/text-to-speech
  • Volume gain control: Increase the volume of the output by up to 16db or decrease the volume up to -96db.

@ClemensGruber ClemensGruber converted this from a draft issue Feb 15, 2024
@ClemensGruber ClemensGruber added bug Something isn't working enhancement-raspi New feature or request RasPi labels Feb 15, 2024
@ClemensGruber
Copy link
Owner Author

ClemensGruber commented Feb 16, 2024

  1. Check if the used software player could be the problem:

    For the second file we used ffplay as software player.
    For the first (GPTree) file we used os.system(f"afplay {filename_output}")
    Check if there is a volume parameter in ffplay vs. afplay what could cause the difference

Inspect both files and analyze it on PC

  • We have started GPTree and initiated a conversation so that a response audio file was generated from the Google Cloud service.
  • You can find the file in folder /audio file output.mp3
  • We compared this file with pixabay.com_are-you-sleeping-145026 what is played much louder on the RasPi.
  • Hearing the two files on PC leads to the same ovservation: GPTree is less loud than the pixabay file, But the pixabay file sounds overdriven and the recording level seems not correct.
  • Loading both files in Audacity and inspecing waveform shows the difference:
  • Image

So different volume levels are caused by the recording, not by the (software) player we used. The pixabay file sound overdriven (much more on the PC than on the Anker speaker), this is "too much", but we have room for improvement on the Google TTS service file and will try to improve volume range to get a louder sound!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement-raspi New feature or request RasPi
Projects
Status: 📋 Backlog-Tech
Development

No branches or pull requests

1 participant