Both /usr/bin/paplay and /usr/bin/aplay are included in libreelec so how would I play an audio file on a vanilla rpi2 on an hdmi TV? Tried a bunch of command line arguments and could not play an audio file from the command line.
Play audio from script
-
yoyoma2 -
September 4, 2018 at 10:25 PM -
Thread is Unresolved
-
-
- Official Post
What sort of file format are you trying to play? wav, mp3 or something else?
-
I've tried both wav and mp3 but can't get anything to play from the command line/script. If a certain format works, I can convert the audio files to that. Note that libreelec (kodi) on rpi2 plays audio just fine on the hdmi tv.
-
-
That sort of works but can it be synchronous? The script's messages begin playing one after the other with only the final message playing to completion.
-
What sort of file format are you trying to play?
-
Make a playlist and play that. You need to decide based on your requirements.
-
What sort of file format are you trying to play?
See post #3
-
Make a playlist and play that. You need to decide based on your requirements.
These are continuously running scripts monitoring/reporting real-time events. Unless a single file playlist will be synchronous/blocking or would play to completion should a subsequent single file playlist be sent, it's the same problem.
Surely the included tools mentioned in post #1 can work with the proper arguments?
-
yoyoma2: Are you a spammer or regular user? Because your answers doesn't make sense. I think it is time to remove you here
-
I'm new to libreelec but have years of openelec use. Which statement was unclear? It's not possible for a script to make a playlist now to announce all messages for future unknown events. The script could only create a playlist of the single file of the message it is trying to announce now. Would this playlist call be synchronous/blocking as opposed to the single file asynchronous/nonblocking method you gave in post #4? Do playlists always play to completion even if another playlist call is made. The single file play call you gave in post #4 does not block and if a second call is made too soon, the currently playing message aborts and the second one begins. Unless the single file playlist behavior is different than the single file behavior, we have the same problem.
Since libreelec includes command line tools for playing audio files mentioned in post #1, there must be a way to use them right?
Sorry if I came across as a spammer. I am genuinely trying to use "paplay" or "aplay" which are part of libreelec.