Playing an MP3 file

newsmp3.mp3

Fairly straighforward

Have you tried to execute this from a - xxxx=playback /path/file.ext and ‘not a script’, which may not have the same owner rights. Which is why I suggested earlier to make it rwx or 777.

???

I’m executing directly from the bash prompt, no script. And I chmod’d the file to 777 for testing purposes. No change - it still throws the same error.

Frustrating!

Mike, your post about playing Newsline using mpg123. Was the platform a Pi and, if so, was it installed from the image or installed onto an existing Raspian OS?

I asked if you executed this from a command setup in asterisk. You are still running from bash.
Call it directly from asterisk with xxxx = cmd /localplay /path/file.spec (in rpt.conf)

ie
8901=localplay,/etc/asterisk/msg/wxfc ; play wx fcst local only

ie call the function/dtmf 8901 from bash if you want. Pick your own non-conflicting command.

Your script is not executing as user or group asterisk when you manually call it. While I do not know for sure, I suspect asterisk is not taking ownership when it makes the execution from bash.
But ‘this is’ a owner/permission issue. Clearly.
Who is the owner of the file ?
Have you tried su or sudo ?

What exact post do you refer because over the years, I’m sure I have made many on mpg123.
If I did not specify, or in reply to a Pi question, likely a PC.
Most instances, should not matter. Asterisk runs the same.
You will need to refresh my memory that is not as good as I would like.

No, I did not call as a command located in rpt.conf because I had not intended to call it that way. HOWEVER, if I must I will. Let me give that a try

As for your previous thread I referenced:

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

Just tried your idea Mike and still a no-go.

I asked about what version ASL you’re running because mine is a 64 bit version running on an x86_64 platform and not sure if that is a factor or not

Deb 9 PC install from iso image and updated along the way.

It was a test.

I got mp3 file playback to work simply by adding load => format_mp3.so to the modules.conf file.
Then you just use rpt playback 123545 /path/to/file
Where 12345 is your node number, and /path/to/file is the absolute path to the mp3 file you want to play, without the .mp3 part of the filename.

Doesn’t work for me. I’m beginning to think there’s a conspiracy :grinning:

As ASL is reporting the following:

Unable to open /etc/asterisk/audio/newsfiles/newsmp3 (format 0x44 (ulaw|slin)

and the mp3 driver is being loaded in modules.conf

load => app_mp3.so 

And since the called mp3 files exists in the stated path, does this not point to a bug in ASL?

I don’t know how to use app_mp3. Does your system not have the format_mp3.so module installed?

There is no format_mp3.so in /usr/lib/asterisk/modules

All the bugs are just in your system I guess. Thanks for taking them for the team.

.

What is the result of

which mpg123

If you are not actually going to do it tell me now so I stop wasting my time as I’m not asking twice+ anymore.

Sorry, I must have missed where you asked me to run this previously

~# which mpg123
/usr/bin/mpg123

TLDR but this might be helpful. https://wiki.allstarlink.org/images/d/dd/RecordingSoundFiles.pdf

I didn’t think mp3 files would play. Try making it a ulaw with Audacity. Specify the full path but don’t include the file extension on the localplay command.

It should play with rpt localplay <nodename> <sound_file_base_name>

.ul plays just fine but I wanted to try an mp3 as it is half the size of the same file in ulaw format.
(there’s a reason I want as small an audio file as possible)

I’m revisiting this 'cause I hate to give up! :rofl:

So, as a refresher, I have an MP3 file (/etc/asterisk/audio/newsfiles/newsmp3.mp3) that is an 8K mono file and is readable by the world

mp3 driver is loaded in modules.conf (load => app_mp3.so) and I’m using a Repeater Builder RIM Lite for my sound codec.

From bash, I run:

/usr/sbin/asterisk -rx 'rpt localplay 1102 /etc/asterisk/audio/newsfiles/newsmp3'

PTT comes up for a second or two, then goes out with no audio played.

/var/log/asterisk/messages shows:


[Oct  4 15:52:34] WARNING[3367] file.c: File /etc/asterisk/audio/newsfiles/newsmp3 does not exist in any format
[Oct  4 15:52:34] WARNING[3367] file.c: Unable to open /etc/asterisk/audio/newsfiles/newsmp3 (format 0x44 (ulaw|slin)): No such file or directory
[Oct  4 15:52:34] WARNING[3367] app_rpt.c: ast_streamfile failed on DAHDI/pseudo-685257807

If I try to play the file from within the asl-menu CLI, exact same results - it fails in the exact same way and same entries in the log.

Since so many insist playing an mp3 is possible and since I’ve followed instructions to a tee, there is something afoot here (and I’m pretty sure it’s not my own stupidity but I’ve been wrong before)

As it turns out, GSM format works (and sounds fine) for NewsLine. An added benefit is the file is only 1.8 megs in size, compared to an MP3 version @ 4.3 megs while the .ul is a whopping 9.7 megs.

I’m good with GSM…

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.