mirror of
https://github.com/lox-audioserver/lox-audioserver.git
synced 2026-04-26 06:45:47 +03:00
[GH-ISSUE #29] Working function block inputs #7
Labels
No labels
bug
enhancement
pull-request
released
released on @beta
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/lox-audioserver#7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mr-manuel on GitHub (Oct 11, 2025).
Original GitHub issue: https://github.com/lox-audioserver/lox-audioserver/issues/29
Could you add to the readme, which function block inputs are supported by this emulator with the different backends?
I'm searching for a replacement for MS4H and the only thing I'm missing currently is the TTS with the Music Assistant backend. Could be maybe tricky, since you would have to generate the audio file somewhere and then upload/play it.
@rudyberends commented on GitHub (Oct 11, 2025):
I’m not entirely sure about this one yet. If it’s audio player related and not already supported, it will be implemented eventually.
I still need to look into the TTS functionality. Music Assistant supports playing announcements, which could be used for short sound effects (alarms, fire alarms, bells, buzzers) and also for TTS messages.
However, you do need a TTS engine that generates the audio file to send to Music Assistant. Home Assistant already supports this, but that would introduce an external dependency. We could also implement our own TTS generation.
There have been some discussions about noticeable delays when using TTS with Music Assistant, which I can definitely imagine being an issue. I’m also curious whether there’s a real use case for this feature.
Do you know of others who actively use it? If there’s enough interest, and if it proves usable without long delays, I might consider implementing it.
@rudyberends commented on GitHub (Oct 12, 2025):
So, I looked into this feature request. I didn’t want to burden the audioserver with a full local TTS stack at first. However, while testing I stumbled onto Google’s lightweight TTS endpoint, which lets us outsource the speech synthesis entirely: the audioserver now sends the text to Google, caches the returned MP3, and feeds it straight to Music Assistant’s “play announcement” action. Coupled with MA’s built-in announcement support, the whole thing turned out to be surprisingly straightforward.
What’s new to test
git checkout feature/alerts-backend && git pullaudio/grouped/tts/<zone>/<LANG|Your+Message>(e.g.audio/grouped/tts/14/ENG|Alarm+is+going+off)audio/grouped/alarm/<zone>for a siren-style endless alertaudio/grouped/alarm/off/<zone>(or/buzzer,/firealarm) to stop itpublic/alerts/, so nothing extra needs to be installed locally.Give it a spin and let me know how it goes!
@mr-manuel commented on GitHub (Oct 12, 2025):
Wow, you are fast. I will test it later. How to choose between a male and female voice?
MS4H works exactly like that. The idea was not to integrate a full TTS software into the lox-audioserver but rather an integration of a popular TTS online service. In the future you could maybe add also support for a local TTS engine, which then can be installed in a separate Docker container. An example is https://github.com/coqui-ai/TTS.
Would it be maybe also possible to add Amazon Polly in addition to Google's TTS endpoint? I think that Polly has the most natural voice.
Here some screenshots of the MS4H setting for Ring, Alarm, Alarm Clock and TTS:
Then as you see in the screenshot the TTS files are cached, so that you don't waste credits if you play the same sentence multiple times.
@mr-manuel commented on GitHub (Oct 12, 2025):
I'm not able to correctly test it. The manual generation of TTS files is working via HTTP GET, but the JSON response contains an invalid
urlvalue. Since I'm using Docker and the Music Assistant is not a Docker container, it cannot reach the IP address that is provided in the JSON response. Therefore I would need to provide the IP address of the Docker host in the JSON response to make it work properly.Current response
Needed response
@rudyberends commented on GitHub (Oct 12, 2025):
If you have access to the data directory, you will find the IP of the Audioserver in the config.json. You can manually change this and restart the server. It will then use this IP.
For final release I will make this configurable in webinterface.
@mr-manuel commented on GitHub (Oct 12, 2025):
Searching through the code, I found out, that I can set the environment variable
ALERTS_HOSTto solve this.github.com/rudyberends/lox-audioserver@4442383a53/src/backend/alerts/alertService.ts (L345)@rudyberends commented on GitHub (Oct 12, 2025):
Yes, that will also work
@mr-manuel commented on GitHub (Oct 12, 2025):
The TTS works very well! How does it select the language, if the TTS is triggered via the function block?
The
Alarm,FireAlarm,BellandBuzzerdo not work yet how they should. They should only play as log as the function block input is on1, if the input then returns to0the previous state should be recovered (player off or music playing). Probably it would be good to implement a minimum playback time of some seconds, in case there was only a short trigger on the function block. Like play the alarm only once and do not loop it.Very nice work!
@rudyberends commented on GitHub (Oct 12, 2025):
Miniserver calls the url like this;
audio/grouped/tts/14/ENG|Alarm+is+going+off
Where Loxone automatically sets the correct language.
I will adjust the other events like you described.
@mr-manuel commented on GitHub (Oct 13, 2025):
When I try to play a TTS on all zones at the same time the system goes crazy. It plays instantly on the first player in the list and then in the next seconds it plays on one player after the other. In total I have 7 audio zones/players. Could it be, that either lox-audioserver or Music Assistant is not able to handle multiple commands at once?
I tried:
The goal would be to play an
Alarm,FireAlarm,Bell,BuzzerandTTSevent in sync on multiple selected players as an announcement in Music Assistant.Maybe grouping over the Loxone app would solve this issue?
@mr-manuel commented on GitHub (Nov 2, 2025):
With v3 we made a few steps back.
TTS does not work anymore.
From the logs it seems fine, but there was no TTS played.
This does not work anymore. It's not an announcement anymore and it does not stop when it turns
0again.Maybe there is a common issue with announcements that causes both (TTS and alerts) to fail.
@rudyberends commented on GitHub (Nov 2, 2025):
I have this working in a test version, but I now use grouped players to send alerts. The only thing is that I can only get It stable on MA versions > 2.7 and that is in beta right now. State changes on those betas are different. I will come back on this. First I want to have stable group support and I will build on that
@mr-manuel commented on GitHub (Nov 2, 2025):
What are grouped players in your case? You use a Loxone function block
Central Audio (Audio Zentral), select your players there and then you send the command on this function block?Like this?
I would also test it with MA > 2.7, no problem, but if you want to wait, it's also fine for me.
In the meanwhile can you make the bell work in some way? It's no problem, if it's not an announcement right now, it would only be nice that at least I hear, if someone rings at the door, no matter how :)
@rudyberends commented on GitHub (Nov 5, 2025):
bell should work in testing
@mr-manuel commented on GitHub (Nov 6, 2025):
Works in testing again thanks.
@rudyberends commented on GitHub (Dec 29, 2025):
what should we do with this one? I will close it for now. Test against the new release when its available so you can open new issue?
@mr-manuel commented on GitHub (Dec 29, 2025):
Fine for me, thanks!