#Vosk and Piper as separate audio services to remote services

1 messages · Page 1 of 1 (latest)

tough patrol
#

My main use case for TTS and STT is from a small device (Raspberry Pi 4/5 or ideally Raspberry Pi Zero 2w)

On a larger Ubuntu machine I find that VOSK and Piper run fine locally, but the same service as a remote gives a not implemented error.

# speech from local Ubuntu client
    speech_vosk = SpeechService.from_robot(robot, name="vosk")
    speech_piper = SpeechService.from_robot(robot, name="piper")
    

    # Quick test speech
    print("Testing speech ouput")
    piper_response = await speech_piper.to_speech("Hello, How can I help you?")
    print(f"Piper response:- length: {len(piper_response)} type: {type(piper_response)} details: {piper_response}")

    speech_text = await speech_vosk.to_text(speech=piper_response, format="wav")
    print(f"Vosk response:- length: {len(speech_text)} type: {type(speech_text)} details: {speech_text}")

From a Raspberry Pi, I cannot access the service

    # Setup vosk and piper for speech
    speech_vosk = SpeechService.from_robot(robot, name="viamubuntulaptop2-main:vosk")
    speech_piper = SpeechService.from_robot(robot, name="viamubuntulaptop2-main:piper")

The latter generates a not implemented error

tough patrol
#

The output from piper.to_speech() or vosk.to_text() on remotes generates the following if that helps debugging.

to_text seems to be changed to ToText and to_speech changed to ToSpeech

Testing speech ouput
2024-04-07 13:10:14,866 ERROR viam (init.py:34) [ERROR] Uncaught exception
Traceback (most recent call last):
File "/home/blm/python/viam_sdk/remote_check.py", line 87, in <module>
asyncio.run(main())
File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/home/blm/python/viam_sdk/remote_check.py", line 58, in main
piper_response = await speech_piper.to_speech("Hello, How can I help you?")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/blm/viam_env/lib/python3.11/site-packages/speech_service_api/api.py", line 179, in to_speech
response: ToSpeechResponse = await self.client.ToSpeech(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

raise GRPCError(status, message, details)

grpclib.exceptions.GRPCError: (<Status.UNIMPLEMENTED: 12>, 'Unimplemented', None)
Traceback (most recent call last):

ebon coral
#

Hi @tough patrol - I have heard that engineering is planning on fixing this issue, aiming for release next Tuesday

tough patrol
tough patrol
#

@ebon coral - still getting same error, but not sure how to upgrade with the new UI - I am on version 0.25.0

ebon coral
#

@tough patrol I’m kind of out of the loop as I was away on vacation all week but I believe @raw bone or @coarse merlin may be able to help as they’ve leveraged the fix this week.

coarse merlin
#

0.25.0 included the fix, assuming it was the same issue I had. @tough patrol give it a few server restarts just to be sure. The 'turn it off and on again' approach has saved me a few times. 😅

tough patrol
# coarse merlin 0.25.0 included the fix, assuming it was the same issue I had. <@973245369758674...

I'm still getting not implemented from

# Setup vosk and piper for speech
    speech_vosk = SpeechService.from_robot(robot, name="viamubuntulaptop2-main:vosk")
    speech_piper = SpeechService.from_robot(robot, name="viamubuntulaptop2-main:piper")
    
    # Quick test speech
    print("Testing speech output")
    piper_response = await speech_piper.to_speech("Hello, How can I help you?")
    print(f"Piper response:- length: {len(piper_response)} type: {type(piper_response)} details: {piper_response}")
#

It still looks like the same error, changing from lower_case_underscore to CamelCase

  File "/home/blm/python/viam_sdk/remote_check.py", line 71, in main
    piper_response = await speech_piper.to_speech("Hello, How can I help you?")
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/blm/viam_env/lib/python3.11/site-packages/speech_service_api/api.py", line 179, in to_speech
    response: ToSpeechResponse = await self.client.ToSpeech(request)

ebon coral
#

Hi @tough patrol - I will try to replicate this today or tomorrow, it should work the same in remotes but perhaps there is still an issue there.