Google Wavenet Error

Hi Folks,

Fairly new to Rhasspy and Wavenet.

I am having an issue where text to speech gives me an error “TtsException 400 Request contains an invalid argument.”

Any assistance in resolving this would be muchly appreciated.

Should be fixed in next release, because the issue is most probably an incorrect language setting
Can you post a bit more lines from before the 400 result?

Thanks happy to wait for the next release.

Here’s the full log

[DEBUG:2020-08-25 10:33:12,576] rhasspytts_wavenet_hermes: <- TtsSay(text='Hello', site_id='LivingRoom', lang=None, id='e25aac04-2a48-43bd-871a-
21e8c74a8e40', session_id='')                                                                                                                   
[DEBUG:2020-08-25 10:33:12,586] rhasspytts_wavenet_hermes: Loading credentials at /profiles/en/tts/googlewavenet/credentials.json               
[DEBUG:2020-08-25 10:33:12,591] google.auth._default: Checking /profiles/en/tts/googlewavenet/credentials.json for explicit credentials as part 
of auth process...                                                                                                                              
[DEBUG:2020-08-25 10:33:12,595] rhasspytts_wavenet_hermes: Calling Wavenet (lang=en-US, voice=en-gb, gender=FEMALE, rate=44100)                 
[DEBUG:2020-08-25 10:33:12,971] google.auth.transport.requests: Making request: POST https://oauth2.googleapis.com/token                        
[DEBUG:2020-08-25 10:33:12,986] urllib3.connectionpool: Starting new HTTPS connection (1): oauth2.googleapis.com:443                            
[DEBUG:2020-08-25 10:33:13,247] urllib3.connectionpool: https://oauth2.googleapis.com:443 "POST /token HTTP/1.1" 200 None                       
[ERROR:2020-08-25 10:33:15,674] rhasspytts_wavenet_hermes: handle_say                                                                           
Traceback (most recent call last):                                                                                                              
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 57, in error_remapped_callable                
    return callable_(*args, **kwargs)                                                                                                           
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/grpc/_channel.py", line 826, in __call__                                             
    return _end_unary_response_blocking(state, call, False, None)                                                                               
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/grpc/_channel.py", line 729, in _end_unary_response_blocking                         
    raise _InactiveRpcError(state)                                                                                                              
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:                                                                
        status = StatusCode.INVALID_ARGUMENT                                                                                                    
        details = "Request contains an invalid argument."                                                                                       
        debug_error_string = "{"created":"@1598351595.673267026","description":"Error received from peer ipv4:172.217.167.106:443","file":"src/c
ore/lib/surface/call.cc","file_line":1055,"grpc_message":"Request contains an invalid argument.","grpc_status":3}"                              
>                                                                                                                                               
                                                                                                                                                
The above exception was the direct cause of the following exception:                                                                            
                                                                                                                                                
Traceback (most recent call last):                                                                                                              
  File "/usr/lib/rhasspy/rhasspy-tts-wavenet-hermes/rhasspytts_wavenet_hermes/__init__.py", line 127, in handle_say                             
    "audio_config": audio_config,                                                                                                               
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/google/cloud/texttospeech_v1/services/text_to_speech/client.py", line 353, in synthes
ize_speech                                                                                                                                      
    response = rpc(request, retry=retry, timeout=timeout, metadata=metadata)                                                                    
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py", line 145, in __call__                           
    return wrapped_func(*args, **kwargs)                                                                                                        
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 59, in error_remapped_callable
[DEBUG:2020-08-25 10:33:12,576] rhasspytts_wavenet_hermes: <- TtsSay(text='Hello', site_id='LivingRoom', lang=None, id='e25aac04-2a48-43bd-871a-
21e8c74a8e40', session_id='')                                                                                                                   
[DEBUG:2020-08-25 10:33:12,586] rhasspytts_wavenet_hermes: Loading credentials at /profiles/en/tts/googlewavenet/credentials.json               
[DEBUG:2020-08-25 10:33:12,591] google.auth._default: Checking /profiles/en/tts/googlewavenet/credentials.json for explicit credentials as part 
of auth process...                                                                                                                              
[DEBUG:2020-08-25 10:33:12,595] rhasspytts_wavenet_hermes: Calling Wavenet (lang=en-US, voice=en-gb, gender=FEMALE, rate=44100)                 
[DEBUG:2020-08-25 10:33:12,971] google.auth.transport.requests: Making request: POST https://oauth2.googleapis.com/token                        
[DEBUG:2020-08-25 10:33:12,986] urllib3.connectionpool: Starting new HTTPS connection (1): oauth2.googleapis.com:443                            
[DEBUG:2020-08-25 10:33:13,247] urllib3.connectionpool: https://oauth2.googleapis.com:443 "POST /token HTTP/1.1" 200 None                       
[ERROR:2020-08-25 10:33:15,674] rhasspytts_wavenet_hermes: handle_say                                                                           
Traceback (most recent call last):                                                                                                              
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 57, in error_remapped_callable                
    return callable_(*args, **kwargs)                                                                                                           
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/grpc/_channel.py", line 826, in __call__                                             
    return _end_unary_response_blocking(state, call, False, None)                                                                               
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/grpc/_channel.py", line 729, in _end_unary_response_blocking                         
    raise _InactiveRpcError(state)                                                                                                              
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:                                                                
        status = StatusCode.INVALID_ARGUMENT                                                                                                    
        details = "Request contains an invalid argument."                                                                                       
        debug_error_string = "{"created":"@1598351595.673267026","description":"Error received from peer ipv4:172.217.167.106:443","file":"src/c
ore/lib/surface/call.cc","file_line":1055,"grpc_message":"Request contains an invalid argument.","grpc_status":3}"                              
>                                                                                                                                               
                                                                                                                                                
The above exception was the direct cause of the following exception:                                                                            
                                                                                                                                                
Traceback (most recent call last):                                                                                                              
  File "/usr/lib/rhasspy/rhasspy-tts-wavenet-hermes/rhasspytts_wavenet_hermes/__init__.py", line 127, in handle_say                             
    "audio_config": audio_config,                                                                                                               
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/google/cloud/texttospeech_v1/services/text_to_speech/client.py", line 353, in synthes
ize_speech                                                                                                                                      
    response = rpc(request, retry=retry, timeout=timeout, metadata=metadata)                                                                    
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/google/api_core/gapic_v1/method.py", line 145, in __call__                           
    return wrapped_func(*args, **kwargs)                                                                                                        
  File "/usr/lib/rhasspy/.venv/lib/python3.7/site-packages/google/api_core/grpc_helpers.py", line 59, in error_remapped_callable

Assuming you are using 2.5.5

Here is the rootcause: the voice should be something like en-gb-Wavenet-C, not just en-gb.
That voice is selected in the settings, but those voices are not yet correctly loaded in the fronted.
This PR is needed for that: https://github.com/rhasspy/rhasspy-supervisor/pull/3
It is already merged, but not yet in 2.5.5.

You can create a work-around by going in Rhasspy to “Advanced”.
Change the “voice:” to anything which can be found here: https://cloud.google.com/text-to-speech/docs/voices

I think you want en-GB-Wavenet-A, en-GB-Wavenet-C or en-GB-Wavenet-F (female voices)

It should than look like this:

"text_to_speech": {
    "system": "wavenet",
    "wavenet": {
        "sample_rate": "44100",
        "voice": "en-GB-Wavenet-A"
    }
},
1 Like