LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Playing (not converting) amr files on Linux (https://www.linuxquestions.org/questions/linux-software-2/playing-not-converting-amr-files-on-linux-613966/)

dotancohen 01-16-2008 07:47 AM

Playing (not converting) amr files on Linux
 
I have a few tens of .amr sound files produced on Nokia 6280's and 6288's that I need to hear on my laptop. Here is an example of such a file (my daughter laughing):
http://dotancohen.com/images/example...v_laughing.amr

I have tried to play with VLC 0.8.6 and mplayer 1.0RC1 on Ubuntu 7.04, but neither of them play the files for me. I did find a program that converts the files to mp3, the Mobile Media Converter (http://www.miksoft.net/mobileMediaConverter.htm), however, I'd like to actually play the files rather than convert them. Google makes me think that Quicktime for Windows might play them but I've no windows box and anyway, I'd like to avoid wine if there is a Linux solution out there.

I do see that it is possible to compile mplayer to play the files if compiled with these options: "--enable-amr_nb --enable-amr_nb-fixed --enable-amr_wb" (found on linuxquestion.org). Are those the only options that I will need? How can I find what options are recommended for Ubuntu installations? I tried searching the mplayer website, but found nothing.

David the H. 01-16-2008 08:29 AM

Your file plays for me with ffmpeg/ffplay. I'm using the package offered by debianmultimedia.org and it shows --enable-libamr-nb and --enable-libamr-wb among the set flags. I don't know what comparable sources are available for *buntu, but I'd be surprised if one wasn't available somewhere. And when I play it in mplayer the output shows that it's calling up the same ffmpeg/libavcodec as the audio decoder.

So I'd say yes, all you need to do is compile mplayer and/or ffmpeg with the listed libamr flags, or find a package source that already has them compiled, and you should be set to go.

dotancohen 01-17-2008 02:24 PM

Thanks, David. How does one go about searching for an mplayer deb that was built with the proper flags? I looked at mplayer from debian-multimedia.org (not debianmultimedia.org, which is a parked page) and I don't see what it was built with.

Can I configure Ubuntu to use the debian-multimedia.org repo? Or is that not recommended? Should I just add "deb http://www.debian-multimedia.org stable main" to sources.list?

David the H. 01-17-2008 11:35 PM

Sorry, my mistake typing the url.

I don't know how to discover the enabled libraries in mplayer, but ffmpeg shows a list of its compiled flags whenever you run it. I think that you don't need to compile mplayer specifically with support as long as ffmpeg/libavcodec has it, since mplayer can use it as a decoder.

You can probably use the debian-multimedia sources in *buntu, since it's based of Debian (sid, I believe), but I don't know how well it will work. Most programs will run, I believe, but there may be differences between the two distros that can cause problems.

I was hoping someone else would pop up here and recommend a repository for *buntu that has the same kind of build. :)

dotancohen 01-22-2008 04:15 PM

Quote:

Originally Posted by David the H. (Post 3026629)
I was hoping someone else would pop up here and recommend a repository for *buntu that has the same kind of build. :)

I was also hoping for that! I don't want to enable a repo for another distro, lest I get myself into the dependency hell that was that hallmark of Fedora's Livna/Dag repos.

andrew.46 02-21-2008 05:33 PM

Hi,

There is a solution and yes mplayer will play these files:


Quote:

Originally Posted by dotancohen (Post 3024458)
I have a few tens of .amr sound files produced on Nokia 6280's and 6288's that I need to hear on my laptop. Here is an example of such a file (my daughter laughing):
http://dotancohen.com/images/example...v_laughing.amr

I took the liberty of downloading this file and playing it as follows:

Code:

andrew@ilium~/Desktop$ mplayer meirav_laughing.amr
MPlayer dev-SVN-r26046-4.1.2 (C) 2000-2008 MPlayer Team
CPU: Intel(R) Pentium(R) 4 CPU 2.40GHz (Family: 15, Model: 2, Stepping: 9)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2

Playing meirav_laughing.amr.
libavformat file format detected.
[lavf] Audio stream found, -aid 0
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 8000 Hz, 1 ch, s16le, 0.0 kbit/0.00% (ratio: 0->16000)
Selected audio codec: [ffamrnb] afm: ffmpeg (AMR Narrowband)
==========================================================================
AO: [oss] 8000Hz 1ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:  82.5 (01:22.5) of 0.0 (unknown)  0.3%

Exiting... (End of file)

So as you see it can be done quite easily with mplayer. BTW I have a grand-daughter who sounds just like that: it is a beautiful and very special time.

Quote:

I do see that it is possible to compile mplayer to play the files if compiled with these options: "--enable-amr_nb --enable-amr_nb-fixed --enable-amr_wb" (found on linuxquestion.org). Are those the only options that I will need? How can I find what options are recommended for Ubuntu installations? I tried searching the mplayer website, but found nothing.
You do not have to specify any options for mplayer, simply install the required libraries and the configure script will pick it up for you. The files are found here:

http://www.penguin.cz/~utx/amr

and mplayer documentation references them here:

http://www.mplayerhq.hu/DOCS/HTML/en/audio-codecs.html

Can I suggest as well that you would be better to use the svn mplayer? I believe you use Ubuntu, if so you could use a walkthrough I have written at:

http://ubuntuforums.org/showthread.php?t=558538

For which I have added an amr section specifically to address your needs:

http://ubuntuforums.org/showpost.php...&postcount=195

Simply install the amr material first, install the svn mplayer and all will be well :-)

Andrew

dotancohen 02-25-2008 04:44 AM

Thank you Andrew. The instructions that you posted on the Ubuntu forum were almost too easy to follow. And you explained _why_, not only _how_. Great job and I thank you.

andrew.46 02-25-2008 05:22 AM

Hi again!

Quote:

Originally Posted by dotancohen (Post 3068909)
Thank you Andrew. The instructions that you posted on the Ubuntu forum were almost too easy to follow. And you explained _why_, not only _how_. Great job and I thank you.

It is my pleasure :-)

Andrew


All times are GMT -5. The time now is 11:44 AM.