AlexxIT / StreamAssist

Home Assistant custom component that allows you to turn almost any camera and almost any speaker into a local voice assistant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No TTS audio playing over Sonos media player

corpsecallosum opened this issue · comments

I am getting the following error when trying to use a Sonos media player. The beep.wav plays after the wake word and commands are executed but I get no TTS audio through my Sonos AMP / ceiling speakers.

ERROR (SyncWorker_45) [homeassistant.components.sonos.media_player] Sonos does not support media type "audio/mpeg"

Thanks for all you do.

What TTS service you using? And what content type supported by Sonos?

@AlexxIT :

I tried to get a Sonos Move 1 up and running. Here my configuration:

image

image

Sometimes (!) the wake word works and I can hear the beep.mp3. Since now I could not find a valid pattern. I think it has to do with turning the Sonos Move Hardware Microphone off and and on again (not the Home Assistant toggle off and on)

image

image


The wake word sometimes works. In case it worked, I never received an answer no matter I asked for.

@corpsecallosum :

Did you get Sonos up and running? Could you please send your configuration?

I'm having the same issue. TTS isn't played on the sonos system. The beep is played when a wakeword is detected and the command is processed aswell, but the TTS isn't played on the sonos system.

commented

Similar issue, only for me, the full process runs but audio is not played, however, I attempted to also cast to Google Display and it activates and shows the media cast player but does not play audio. The audio is correctly generated and stored in the debug route. Only the media players do not play the audio. Browser will play the audio in debug mode.

HA on Docker on Synology DSM (bridge)
Sonos
Nabu Casa (for temporary SSL work as I setup direct with LetsEncrypt)
Google Home Hub
Voice Assistant = Home Assist + OpenAI Extended
STT and TTS from Home Assistant Cloud (Nabu Casa)
OpenWakeWord with custom wake word also on docker on synology

Here's the full debug that does everything as it should, but does not successfully play audible messages on media players:

stage: done
run:
  pipeline: 01hxerdczhgm6hrjrgskk
  language: en
events:
  - type: run-start
    data:
      pipeline: 01hxerdczhgm6hrjrgskk
      language: en
    timestamp: "2024-06-07T14:42:32.596918+00:00"
  - type: wake_word-start
    data:
      entity_id: wake_word.openwakeword
      metadata:
        format: wav
        codec: pcm
        bit_rate: 16
        sample_rate: 16000
        channel: 1
      timeout: 0
    timestamp: "2024-06-07T14:42:32.597112+00:00"
  - type: wake_word-end
    data:
      wake_word_output:
        wake_word_id: yoh_steve
        wake_word_phrase: yoh steve
        timestamp: 242230
    timestamp: "2024-06-07T14:50:37.063517+00:00"
  - type: stt-start
    data:
      engine: stt.home_assistant_cloud
      metadata:
        language: en-US
        format: wav
        codec: pcm
        bit_rate: 16
        sample_rate: 16000
        channel: 1
    timestamp: "2024-06-07T14:50:37.063803+00:00"
  - type: stt-vad-end
    data:
      timestamp: 249770
    timestamp: "2024-06-07T14:50:52.159934+00:00"
  - type: stt-end
    data:
      stt_output:
        text: Who is the 19th president?
    timestamp: "2024-06-07T14:50:52.280523+00:00"
  - type: intent-start
    data:
      engine: 4271e88f353b909b75c0ee302e1d1046
      language: "*"
      intent_input: Who is the 19th president?
      conversation_id: null
      device_id: null
    timestamp: "2024-06-07T14:50:52.280771+00:00"
  - type: intent-end
    data:
      intent_output:
        response:
          speech:
            plain:
              speech: The 19th president of the United States was Rutherford B. Hayes.
              extra_data: null
          card: {}
          language: "*"
          response_type: action_done
          data:
            targets: []
            success: []
            failed: []
        conversation_id: 01HZSJWPGMMSA6WYWM6CD1Z3GX
    timestamp: "2024-06-07T14:50:53.973941+00:00"
  - type: tts-start
    data:
      engine: cloud
      language: en-US
      voice: ChristopherNeural
      tts_input: The 19th president of the United States was Rutherford B. Hayes.
    timestamp: "2024-06-07T14:50:53.974167+00:00"
  - type: tts-end
    data:
      tts_output:
        media_id: >-
          media-source://tts/cloud?message=The+19th+president+of+the+United+States+was+Rutherford+B.+Hayes.&language=en-US&voice=ChristopherNeural
        url: >-
          /api/tts_proxy/d05747f0baa3baf9940ab340f38fa5315da3dac8_en-us_99802492eb_cloud.mp3
        mime_type: audio/mpeg
    timestamp: "2024-06-07T14:50:54.015433+00:00"
  - type: run-end
    data: null
    timestamp: "2024-06-07T14:50:54.016634+00:00"
wake_word:
  entity_id: wake_word.openwakeword
  metadata:
    format: wav
    codec: pcm
    bit_rate: 16
    sample_rate: 16000
    channel: 1
  timeout: 0
  done: true
  wake_word_output:
    wake_word_id: yoh_steve
    wake_word_phrase: yoh steve
    timestamp: 242230
stt:
  engine: stt.home_assistant_cloud
  metadata:
    language: en-US
    format: wav
    codec: pcm
    bit_rate: 16
    sample_rate: 16000
    channel: 1
  done: true
  stt_output:
    text: Who is the 19th president?
intent:
  engine: 4271e88f353b909b75c0ee302e1d1046
  language: "*"
  intent_input: Who is the 19th president?
  conversation_id: null
  device_id: null
  done: true
  intent_output:
    response:
      speech:
        plain:
          speech: The 19th president of the United States was Rutherford B. Hayes.
          extra_data: null
      card: {}
      language: "*"
      response_type: action_done
      data:
        targets: []
        success: []
        failed: []
    conversation_id: 01HZSJWPGMMSA6WYWM6CD1Z3GX
tts:
  engine: cloud
  language: en-US
  voice: ChristopherNeural
  tts_input: The 19th president of the United States was Rutherford B. Hayes.
  done: true
  tts_output:
    media_id: >-
      media-source://tts/cloud?message=The+19th+president+of+the+United+States+was+Rutherford+B.+Hayes.&language=en-US&voice=ChristopherNeural
    url: >-
      /api/tts_proxy/d05747f0baa3baf9940ab340f38fa5315da3dac8_en-us_99802492eb_cloud.mp3
    mime_type: audio/mpeg
commented

I don't see where my media_player.living_room and other targets are set in this debug, the targets [] is empty, perhaps a bug in the code in populating this from the modal?