Playing an MP3 file

I feel like a noob but I’ve had no luck getting MP3s to play on my local node. I’ve searched the forums and found 2 relevant threads (one recently about Newline broadcasts by creating a stanza to use the autopatch feature to play an MP3

https://community.allstarlink.org/t/play-arnewsline-direct-as-mp3-and-automate-howto/20103

as well as an older thread from 2014 about an MP3 overlay but I am unable to get either to work.

https://community.allstarlink.org/t/playing-mp3-files-in-app-rpt/11101

Log reports the mp3 file isn’t found but it is where I point!

(yes, I load the mp3.so driver in module.conf).

I should point out I’ve no problems playing a ulaw file but I’d like to deal with MP3s as well

Check the permissions on the file. /ownership as well.

just as the ulaw version is, the mp3 readable by the world

Do keep in mind it saying ‘file not found’ so it’s a OS level thing.

From the directory of file, what is the result of

find . -name “myfile.mp3”

And are you sure it is case correct and there is no leading “.” in front of it.

As one other test, set it as permission 777 /all/anyone r/w/e - as the mp3 player may have other rights/owner.

The file is there and permissions are correct:

root@ButtevilleASL:~# ls -l /etc/asterisk/audio/newsfiles
total 30344
-rw-r--r-- 1 root root   86935 Sep 30  2005 larsid2short.mp3
-rw-r--r-- 1 root root   30818 May 23  2021 newsline_10.ul
-rw-r--r-- 1 root root   34209 May 23  2021 newsline_5.ul
-rw-r--r-- 1 root root 4809769 Jul  1 08:12 news.mp3
-rw-r--r-- 1 root root   91762 May 23  2021 newstonight.ul
-rw-r--r-- 1 root root 9121848 Jun 24 10:13 news.ul

and the command I’m using to call it:

/usr/sbin/asterisk -rx 'rpt localplay 1100 /etc/asterisk/audio/newsfiles/news.mp3'

Calling the .ul version works fine

/usr/sbin/asterisk -rx 'rpt localplay 1100 /etc/asterisk/audio/newsfiles/news'

And here are the log entries of the failure (/var/log/asterisk/messages)

Jul  4 11:18:24] WARNING[6216] file.c: File /etc/asterisk/audio/newsfiles/news.mp3 does not exist in any format
[Jul  4 11:18:24] WARNING[6216] file.c: Unable to open /etc/asterisk/audio/newsfiles/news.mp3 (format 0x44 (ulaw|slin)): No such file or directory

Set permission to rwx for owner or 744 octal on the file.

Or, as I asked before, rwx rwx rwx / 777 and clear this up.

Same results, same error(s)

If you do like localplay news (I’m abbreviating the commands) then it’s searching for a file like news.ul, which it finds. But if you do localplay news.mp3 it’s going to search for news.mp3.ul which doesn’t exist.

If you want to make sure it’s playing that file then you need to rename it, for example to newsmp3.mp3 then try localplay newsmp3.

In summary asterisk needs the filename to not have the extension on it. It will automatically search through supported extensions.

Nope

mv /etc/asterisk/audio/newsfiles/news.mp3 /etc/asterisk/audio/newsfiles/newsmp3.mp3
 /usr/sbin/asterisk -rx 'rpt localplay 1100 /etc/asterisk/audio/newsfiles/newsmp3'
[Jul  5 07:43:00] WARNING[14046] file.c: File /etc/asterisk/audio/newsfiles/newsmp3 does not exist in any format
[Jul  5 07:43:00] WARNING[14046] file.c: Unable to open /etc/asterisk/audio/newsfiles/newsmp3 (format 0x44 (ulaw|slin)): No such file or directory
[Jul  5 07:43:00] WARNING[14046] app_rpt.c: ast_streamfile failed on DAHDI/pseudo-1545420597

To me, it seems to only be looking for a ulaw file and not the mp3. Even though I have the mp3.so driver loading in modules.conf

A bug perhaps?

Isn’t the mp3 addon called format_mp3.so, not mp3.so?

load => app_mp3.so ; Silly MP3 Application

Bug? - Mine works fine, but I do not put it in the directory with other asterisk sounds.
And I specify that dir along with the complete filename on playback.

No filespec. I believe you need to specify the filespec as a .mp3 or mp3player no work. It’s expected.
It is not a native format. Handled by asterisk only by the so module.

make sure you are saving the mp3 as an 8k mono file. You do not specify an extension to play it.
/usr/bin/asterisk -rx “rpt localplay your_node_number /etc/asterisk/audio/newsfiles/newsmp3”

you node number is you node that you want it to play on. if your trying to play it on a node with Dahdi/psuedo it will not play as it does not allow Telemetry which is what this would be.

/usr/sbin/asterisk -rx 'rpt localplay 1100 /etc/asterisk/audio/newsfiles/newsmp3.mp3'

Same failure, same log errors

This node (1100) has a RIM-Lite on it and using usbradio with it

What is the exact filename ?

And have you tried playback over localplay for a test ?

As I posted, the ulaw version works fine:

/usr/sbin/asterisk -rx 'rpt playback 1100 /etc/asterisk/audio/newsfiles/news'

Neither of the following work

/usr/sbin/asterisk -rx 'rpt playback 1100 /etc/asterisk/audio/newsfiles/newsmp3.mp3'
/usr/sbin/asterisk -rx 'rpt playback 1100 /etc/asterisk/audio/newsfiles/newsmp3'

An

What is the exact filename ? as it sits .

newsmp3.mp3

Fairly straighforward