My first Custom Component: Google Cloud TTS

I’m a fan of Google Cloud TTS, but the problem that “we only use 1 voice name at the same time”, that’s now I’m create the first component Google Cloud TTS to do it

This is the example of speaking using this Service

script:
  gg_reading_01:  #May be from your script name
    sequence:  
    - service: tts_ggcloud.say
      data_template:
        entity_id: media_player.van_phong  #May be from your entity speaker
        message: "Your text input here" #May be from your input_text
        speed: '1.0' #May be from your input_number
        pitch: '0' #May be from your input_number
        language: "vi-VN" #May be from your input_select
        voice_name: "vi-VN-Wavenet-A"  #May be from your input_select

Check in link:

Tks for reading!

sorry, but I didn’t understand. What the custom component allows us to do?

By the looks of it, it enables a TTS service built on more natural sounding wavenet voices than the default google tts service (which I think uses google translate).

Benefits are better sounding, more control over intonation, delays etc, lots of voices to choose from and different nationalities.

It probably needs a google API key, which is limited to a certain volume of characters before you have to pay. However, that limit is pretty high, I use it through node-red for announcements around the house and never come close.

Now I understood. Thanks :slight_smile:

Do you know what is the limit of the number of characters before we have to pay?

If I read it right, it’s 1m characters per month before you pay, that includes all the characters in the message (e.g. control characters, headers etc.) not just those that are spoken.

This custom component enable multiple Google Cloud TTS Voice at the same time, for example with Vietnamese language (languageCode = vi-VN) we can select 1 of 8 voices at the same time

voice_list = {'Google_Voice_1': 'vi-VN-Wavenet-A', 'Google_Voice_2': 'vi-VN-Wavenet-B', 'Google_Voice_3': 'vi-VN-Wavenet-C', 'Google_Voice_4': 'vi-VN-Wavenet-D', 'Google_Voice_5': 'vi-VN-Standard-A', 'Google_Voice_6': 'vi-VN-Standard-B', 'Google_Voice_7':'vi-VN-Standard-C' , 'Google_Voice_8':'vi-VN-Standard-D'}
1 Like