Required a step-by-step guide on how to play sounds and media through a 3.5mm audio jack

I did follow the instructions but no way, i was not able to get it to work :frowning:
picotts installed and running, config/www/ contains only one wav file for testing but i only need TTS
Any idea ?
Thanks
Eddy



image
configuration.yaml contains:
image
I also tried tons of conbinations for the subdir but not sure the problem is there.

Starting with the very comprehensive documentation you posted:
from the log it seems that everything went well (no error message after the test) and that the test was carried out regularly
Most likely the problem is in the output:

  1. the speaker connected to the Raspberry AUX OUT has too low impedance
  2. the jack is not of the 3-way type
  3. the connection cable is faulty
  • I recommend trying to insert earphones into the AUX OUT of the Raspberry, then restart the add-on, to do a final test
  • Alternatively, with the speaker turned on, put a music.wav file in the /media directory and give from the SSH & Terminal add-on
    the command aplay /media/music.wav to see if the speaker is suitable.

Additional non-essential clarifications:
The subdirectory is to be set only if needed and is in addition, in case you refer me it is to be removed, if you put the files in config/www you leave it empty.
For example, if I write “audio”, the files are in config/www/audio.
In configuration.yaml
-tts: platform: picotts
is superfluous, the message is sent directly to the standard port 59126 of the picotts add-on.
The proof by marking music_test and tts_test is self contained in the add-on and starts at startup (a piece of piano music of about 10 seconds and the phrase Pico tts demo + hour + minutes).
By checking debug you get verbose messages, useful for problem determination, but in our case it seems that everything is going well.

Let me know the results of the tests, I remain available for further information

Thank you for creating this. I managed to add the store using “GitHub - guido-syseng/Hassio-Addons

The only Issue I have is that when I actually want to install the addon it tells me “all SubConns are in TransientFailure, latest connection error: connection error: desc = “transport: Error while dialing dial unix:///var/run/docker/containerd/containerd.sock: timeout”: unavailable”

Did you delete files from the docker?

  1. I have not changed the guido-syseng/Hassio-Addons library in any way for several days
  2. Main features of my installation (from Supervisor → Info):
System Health
version: core-2021.5.5
installation_type: Home Assistant OS
host_os: Home Assistant OS 5.13
update_channel: stable
supervisor_version: supervisor-2021.04.3
docker_version: 19.03.15
  1. As a test I just uninstalled and reinstalled the Add-on Notifier from the GitHub libraries and it works perfectly.

Are you using Hass.OS and is it updated to the latest version?

Hi Guido, thank you for your help.
Audio output was working really fine from the beginning, the following test automation plays the captach.wav file perfectly on the amplified speaker connected. But TTS is not working at all :upside_down_face: :upside_down_face: :upside_down_face:
This automation is triggered when i press an “unused” button on an old chacon rf433 remote (with rflink).
aplay and paplay, both commands are working fine. I don’t know wich one is better ? If someone knows… thanks :wink:

image

And i found also an interresting thing: adding an “&” at the end of the command launch the command in background… Processing does NOT wait the end of command execution (sound file playing in this case).
Here below, an example with 2 wav files playing almost simultaneously :slight_smile:
image

Only now I have seen your answer and the action you set to make TTS work.
It seems to me that you will have to replace
addon: 3ebf62bd-notifier
with
addon: 3ebf62bd_notifier
Let me know the result

Hi Guido. You got it :slight_smile: Now, it works.
Thank you
Eddy

For your second question
aplay and paplay, both commands are working fine. I don’t know wich one is better?

There is a further alternative, compared to aplay or paplay, and it is notifier (which uses Sox’s play command internally)

  • you can adjust the volume for each music file
  • you can listen to mp3 as well as wav

The music files must be in media / www, without having to indicate the folder each time.
Take your example of the notifier for the TTS and replace
input:
volume: 99
message: “TEST”
with
input:
volume: 99
music: “gong-school-bell-hit-3.wav”

Hello @guido-syseng!

Thanks for creating this great addon. I was wondering: does it work with any TTS provider? I’m using Amazon Polly for the moment.

Also, I have a suggestion, not sure if possible: would be nice to use both left and right channels as a single, individual, mono output for different speakers, on different rooms :slight_smile:

Thanks!

Thanks Guido ! Works great :slight_smile:

Eddy

Hello,
I have a problem with notifier on my second HA instance: tts works fine but not mp3
My second instance is on port 8124 because i had problems with upnp conflict: both HA wanted to map port 8123 on my router…
So so the problem is that notifier add-on does not permit to select port…
Here is the log:
wget: can’t connect to remote host (127.0.0.1): Connection refused
play FAIL formats: can’t open input file URL `http://localhost:8123/local/Volume_du_haut-parleur_modifie.mp3’:
[21:48:53] ERROR: Invalid audio
[EDIT]: Change port of my remote HA instance to 8123 and Notifier is now working perfectly :slight_smile:
Conclusion: If someone is using another port (other than 8123), Notifier won’t work… :japanese_ogre:

@guido-syseng , does Notifier only work with RaspberryPi or should it work any hardware running HA? I use a NUC and could not get Notifier working. The configuration screen only has output options for “Default” and “Dummy Output”. Any advice?

Thanks.

1 Like

Hi, same issue here on Intel NUC :

EDIT : Solved by settings 8.8.8.8 as default DNS in the HAOS Supervisor.

@guido-syseng Thanks for your great addon! Got it working on my RPI 3+ and am finally able to play MP3’s and send messages to my connected speaker.

What is wrong with the auto generated automation script?
System sound working just fine.
Absolute directory is '/media/file.mp3
Card on Dashboard shows file playing, but no sound.

 action:
  - service: media_player.play_media
    target:
      entity_id: media_player.vlc_telnet
    data:
      media_content_id: '/media/classic-door-bell.mp3'
      media_content_type: music
    metadata: {}
  mode: single
1 Like

I use this and it works fine:

  - service: media_player.play_media
    target:
      entity_id: media_player.vlc_telnet
    data:
      media_content_id: http://IP.OFY.OUR.HA:8123/local/ns-ding-dong.mp3
      media_content_type: music

My mp3’s are stored in config/www/

https://thehelpfulidiot.com/playing-a-sound-directly-from-home-assistant-operating-system#comment-3820

I want to use the 3.5mm jack on the Rpi 4 I have and followed this how to I linked. But it didn’t work for me. not sure what I am doing wrong…

I am posting it here because maybe it can help someone else.

I was eventually able to get it to work using the link I sent earlier, but I found a better way

install local vlc then install telnet. Follow the instructions from the thread Iinked

1 Like

This addon works perfect!
Thank you!

Dear Guido, I get an error when I start an automation with local audio play:
wget: error getting response: Invalid argument
play FAIL formats: can’t open input file URL `http://localhost:8123/local/beep.mp3’:
[12:35:44] ERROR: Invalid audio

I don’t configure the path for audio files, only copied mp3 to config/www folder.
Could you help me?