Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 6 123 ... LastLast
Results 1 to 10 of 56
  1. #1
    Senior Member
    Join Date
    Aug 2012
    Location
    Austria
    Posts
    1,209

    [Announce] LMS Announce - play announcements / notifications

    LMS Announce is a plugin providing a web API for playing announcements / notifications (audio / speech), enabling integration with anything able to call an URL with parameters.
    More information on the homepage
    Various SW: Web Interface | TUI | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | DB Optimizer | Image Enhancer | Chiptunes | LMSlib2go | ...
    Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...

  2. #2
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    4,352
    Well done for pulling this together.

    First suggestion for addition (and I have not even tried it yet) ...
    In the Announce function how about a pre-roll/post-roll configurable sound (to make a "bing bong" to get attention of audience)?
    Could be a default pair of sounds and disabled ... then enable and choose other sounds via GET parameter.
    Last edited by Paul Webster; 2018-05-28 at 06:33.
    Paul Webster
    http://dabdig.blogspot.com
    Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, Supla Finland, ABC Australia, CBC/Radio-Canada and RTE Ireland

  3. #3
    Senior Member
    Join Date
    Aug 2012
    Location
    Austria
    Posts
    1,209
    Quote Originally Posted by Paul Webster View Post
    In the Announce function how about a pre-roll/post-roll configurable sound (to make a "bing bong" to get attention of audience)?
    Could be a default pair of sounds and disabled ... then enable and choose other sounds via GET parameter.
    Interesting idea, but too much effort unless there is a huge demand for it (very unlikely imho)
    Workaround:
    - for static announcements, use a playlist
    - for speech, install sox and create a shell script:
    Code:
     #!/bin/bash                                                                                                                                                                                                                                       
    SOUND=/path/to/beep.flac 
    while getopts "o:t:" opt; do
            case $opt in
                    o)
                    DESTFILE="$OPTARG"
                    ;;
                    t)
                    TEXT="$OPTARG"
                    ;;
            esac
    done
    mimic -o "${DESTFILE}.tmp" -voice slt -t "$TEXT"
    sox "${DESTFILE}.tmp" -t sox - channels 2 rate 44100 | sox "$SOUND" -t sox - "$DESTFILE" 
    rm  "${DESTFILE}.tmp"
    and use it as a TTS engine:
    Code:
    	"mimic-beep": {
    		"cmd": "/path/to/script.sh",
    		"output": "-o ",
    		"options": "",
    		"text": "-t"
    	}
    Various SW: Web Interface | TUI | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | DB Optimizer | Image Enhancer | Chiptunes | LMSlib2go | ...
    Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...

  4. #4
    Junior Member
    Join Date
    Oct 2018
    Posts
    9
    Thank you for this plugin!

    I am testing it now, and it almost works. However, there are some problems:
    1. If the current playlist has "repeat" activated, the announce will go in loop forever.
    2. The original playlist does not continue after the announce


    I have only tested announceFile and announceTTS so far using wget, and the sound is played. But I get this error in the log:
    Code:
    [18-11-03 12:27:50.6108] Slim::Formats::Playlists::Base::playlistEntryIsValid (125) Warning: file:///storage/nfs-share/music/ripped/%EF%BB%BF%23EXTM3U found in playlist:
            file:///storage/nfs-share/playlists/announceTTS.m3u doesn't exist on disk - skipping!
    I'm not sure if it is something wrong with an existing playlist that I have, but I could not find any reference to the music/ripped folder in any of my playlists. Also, announceTTS.m3u does not exist, but I do get tempplaylist_XXX.m3u files in that folder.

    So it seems something is failing when the playlist is to be resumed. I turned loglevel to Debug, and this is what I see in the log (MAC scrambled):
    Code:
    [18-11-03 12:42:20.8647] Plugins::LMSannounce::Plugin::handleJSONP (189) handleJSONP cmd=announceFile pid=00:04:20:00:00:00
    [18-11-03 12:42:20.8692] Plugins::LMSannounce::Plugin::announceFile (280) announceFile called: file=/storage/nfs-share/announce/Rhumba-beat-75-bpm.wav
    [18-11-03 12:42:20.8812] Plugins::LMSannounce::Plugin::__ANON__ (288) announceFile: plid=4476
    [18-11-03 12:42:20.9145] Slim::Formats::Playlists::Base::playlistEntryIsValid (125) Warning: file:///storage/nfs-share/playlists/%EF%BB%BF%23EXTM3U found in playlist:
            file:///storage/nfs-share/playlists/announceTTS.m3u doesn't exist on disk - skipping!
    [18-11-03 12:42:20.9148] Slim::Formats::Playlists::Base::playlistEntryIsValid (125) Warning: file:///storage/nfs-share/music/ripped/%EF%BB%BF%23EXTM3U found in playlist:
            file:///storage/nfs-share/playlists/announceTTS.m3u doesn't exist on disk - skipping!
    [18-11-03 12:42:20.9928] Plugins::LMSannounce::Plugin::playlistLoadedCallback (242) playlistLoadedCallback called for cmd playlist load_done
    [18-11-03 12:42:29.4821] Plugins::LMSannounce::Plugin::playlistStoppedCallback (217) playlistStoppedCallback called for cmd playlist stop
    [18-11-03 12:42:29.4826] Plugins::LMSannounce::Plugin::playlistStoppedCallback (222) playlistStoppedCallback: playerid=00:04:20:00:00:00
     tmppls=tempplaylist_0004202ce3f6 time=22.1893183555603
    [18-11-03 12:42:29.5078] Plugins::LMSannounce::Plugin::__ANON__ (227) playlistStoppedCallback: resume done
    [18-11-03 12:42:29.5084] Plugins::LMSannounce::Plugin::__ANON__ (229) deleting /tmp/annTTS.wav
    It says "resume done", but it is not. Any ideas on what goes wrong here? How can I get rid of that playlist warning?


    EDIT: I tried to unsynchronize the player, and then it worked. So, the problem is probably related to my multi player setup. I see that this is not tested, and I'd like contribute to make this work.
    Last edited by squim; 2018-11-03 at 05:13. Reason: Added info

  5. #5
    Senior Member
    Join Date
    Aug 2012
    Location
    Austria
    Posts
    1,209
    Quote Originally Posted by squim View Post
    If the current playlist has "repeat" activated, the announce will go in loop forever.
    I've released an update which should fix this.

    Quote Originally Posted by squim View Post
    I have only tested announceFile and announceTTS so far using wget, and the sound is played. But I get this error in the log:
    Code:
    [18-11-03 12:27:50.6108] Slim::Formats::Playlists::Base::playlistEntryIsValid (125) Warning: file:///storage/nfs-share/music/ripped/%EF%BB%BF%23EXTM3U found in playlist:
            file:///storage/nfs-share/playlists/announceTTS.m3u doesn't exist on disk - skipping!
    I'm not sure if it is something wrong with an existing playlist that I have, but I could not find any reference to the music/ripped folder in any of my playlists. Also, announceTTS.m3u does not exist, but I do get tempplaylist_XXX.m3u files in that folder.
    I get the the same message, you can ignore it.
    (Technical background: LMS writes 3 wierd characters (´╗┐ (hex %EF%BB%BF)) at the start of a playlist file, which I already had to work around when reading it from other applications. The plugin, however, only uses the LMS API, so this is the first time I've seen LMS having problems reading it's own playlists. Not sure how to handle this, maybe I'll file an issue with Logitech))

    Quote Originally Posted by squim View Post
    So it seems something is failing when the playlist is to be resumed. I turned loglevel to Debug, and this is what I see in the log (MAC scrambled):
    Code:
    [18-11-03 12:42:20.8647] Plugins::LMSannounce::Plugin::handleJSONP (189) handleJSONP cmd=announceFile pid=00:04:20:00:00:00
    [18-11-03 12:42:20.8692] Plugins::LMSannounce::Plugin::announceFile (280) announceFile called: file=/storage/nfs-share/announce/Rhumba-beat-75-bpm.wav
    [18-11-03 12:42:20.8812] Plugins::LMSannounce::Plugin::__ANON__ (288) announceFile: plid=4476
    [18-11-03 12:42:20.9145] Slim::Formats::Playlists::Base::playlistEntryIsValid (125) Warning: file:///storage/nfs-share/playlists/%EF%BB%BF%23EXTM3U found in playlist:
            file:///storage/nfs-share/playlists/announceTTS.m3u doesn't exist on disk - skipping!
    [18-11-03 12:42:20.9148] Slim::Formats::Playlists::Base::playlistEntryIsValid (125) Warning: file:///storage/nfs-share/music/ripped/%EF%BB%BF%23EXTM3U found in playlist:
            file:///storage/nfs-share/playlists/announceTTS.m3u doesn't exist on disk - skipping!
    [18-11-03 12:42:20.9928] Plugins::LMSannounce::Plugin::playlistLoadedCallback (242) playlistLoadedCallback called for cmd playlist load_done
    [18-11-03 12:42:29.4821] Plugins::LMSannounce::Plugin::playlistStoppedCallback (217) playlistStoppedCallback called for cmd playlist stop
    [18-11-03 12:42:29.4826] Plugins::LMSannounce::Plugin::playlistStoppedCallback (222) playlistStoppedCallback: playerid=00:04:20:00:00:00
     tmppls=tempplaylist_0004202ce3f6 time=22.1893183555603
    [18-11-03 12:42:29.5078] Plugins::LMSannounce::Plugin::__ANON__ (227) playlistStoppedCallback: resume done
    [18-11-03 12:42:29.5084] Plugins::LMSannounce::Plugin::__ANON__ (229) deleting /tmp/annTTS.wav
    It says "resume done", but it is not. Any ideas on what goes wrong here? How can I get rid of that playlist warning?
    EDIT: I tried to unsynchronize the player, and then it worked. So, the problem is probably related to my multi player setup.
    I've changed the target of the resume api call in the new version, check if this makes a difference in a synchronized setup.
    Various SW: Web Interface | TUI | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | DB Optimizer | Image Enhancer | Chiptunes | LMSlib2go | ...
    Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...

  6. #6
    Junior Member
    Join Date
    Aug 2011
    Posts
    24
    Thanks for creating a great plugin!
    Works perfectly with Home Assistant.

    Thanks!

  7. #7
    Junior Member
    Join Date
    Oct 2011
    Posts
    20

    Always plays on the same SqueezeBox player

    Great work on the plugin!

    Just one issue I've come across. I have 3 SqueezeBox players, and I'm unable to play announcements on all of them. Regardless of which playerid I specify in the announceFile API call, the announcement is always played on the same SqueezeBox player. I've enabled debug logging and I can definitely see that the different MAC addresses are being received by the plugin, but for some reason, LMS always plays the file on the same player regardless of the MAC address requested.

    Has anyone else been able to get this working across multiple players, using announceFile?

    Thanks!
    Pete

  8. #8
    Senior Member
    Join Date
    Aug 2012
    Location
    Austria
    Posts
    1,209
    Quote Originally Posted by petar View Post
    Regardless of which playerid I specify in the announceFile API call, the announcement is always played on the same SqueezeBox player. I've enabled debug logging and I can definitely see that the different MAC addresses are being received by the plugin, but for some reason, LMS always plays the file on the same player regardless of the MAC address requested.
    Specifying a player isn't currently implemented, unfortunately. I thought about supporting this (that's why the player id can be passed as a parameter), but never got around to actually adding the functionality to the plugin.
    Various SW: Web Interface | TUI | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | DB Optimizer | Image Enhancer | Chiptunes | LMSlib2go | ...
    Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...

  9. #9
    Senior Member
    Join Date
    May 2010
    Location
    London, UK
    Posts
    805
    Quote Originally Posted by Roland0 View Post
    I get the the same message, you can ignore it.
    (Technical background: LMS writes 3 wierd characters (´╗┐ (hex %EF%BB%BF)) at the start of a playlist file, which I already had to work around when reading it from other applications. The plugin, however, only uses the LMS API, so this is the first time I've seen LMS having problems reading it's own playlists. Not sure how to handle this, maybe I'll file an issue with Logitech))
    It's a BOM (https://en.wikipedia.org/wiki/Byte_order_mark), which for some reason LMS always puts at the start of a playlist file. (See https://github.com/Logitech/slimserv...ts/Base.pm#L75).

    And it seems that playlistEntryIsValid will issue a warning when it sees it ! (https://github.com/Logitech/slimserv...s/Base.pm#L108).

  10. #10
    Senior Member
    Join Date
    Aug 2012
    Location
    Austria
    Posts
    1,209
    Quote Originally Posted by mrw View Post
    It's a BOM (https://en.wikipedia.org/wiki/Byte_order_mark), which for some reason LMS always puts at the start of a playlist file. (See https://github.com/Logitech/slimserv...ts/Base.pm#L75).

    And it seems that playlistEntryIsValid will issue a warning when it sees it ! (https://github.com/Logitech/slimserv...s/Base.pm#L108).
    Good catch - I've read about BOMs, but didn't make the connection. I'm, however, still not sure why this issue only occurs in this specific case, and not e.g. when LMS reads a playlist from disk.
    I'll open an issue with Logitech about it.
    Various SW: Web Interface | TUI | Playlist Editor / Generator | Music Classification | Similar Music | Announce | EventTrigger | DB Optimizer | Image Enhancer | Chiptunes | LMSlib2go | ...
    Various HowTos: build a self-contained LMS | Bluetooth/ALSA | Control LMS with any device | ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •