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”
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
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
Conclusion: If someone is using another port (other than 8123), Notifier won’t work…
@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?
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
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?
I tried the VLC addon a while ago, and found that it would often fail to play my audio, or be very choppy in its play back and never found a solution. Its possible its better now, or something specific in my setup caused the issue (virtual box on windows running HAOS) and how audio is passed through.
In the end I went a different direction using an old mobile phone I had lying around using the bubbleupnp app. I can now select the phone as a media player, and use its 3.5mm jack to output the audio to any connected speaker.
It’s worked, played the test song.
I think the issue is with source path: I use DuckDNS add-on and I can’t acces with local IP for HA, only with Duckdns. So this path: (`http://localhost:8123/local/beep.mp3’ isn’t correct.
How can I configure this correctly?
yes, the problem is the local access. I changed configuration.yaml and removed duckdns registry and installed and configured nginx. After that everything works fine! Thank you!
This solution is not good for me. I need DuckDNS, but with dnsmasq I can access in local network only with https. So this path is not good for me: http://localhost:8123/local/
could I change it?
At the moment (April 2024) the following setup works without any add-ons:
You will need Pulse Audio client binaries (pacat, paplay, pactl). They used to be present in the main HA container, but were removed. However, all libraries required by those binaries are still present in the main container
Take those binaries from the hassio_audio container and copy them to /media as follows:
These commands can be run either from the host OS (if you have access to it, e.g. you are running HA supervised) or from the Advanced Terminal add-on. While doing this, you can verify whether HA would send the sound to the sound card you are expecting: run pactl info and verify whether “Default sink” is showing what you are expecting. If you have access to the host OS, the command would be: docker exec -it hassio_audio /usr/bin/pactl info.