LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 07-05-2004, 01:50 PM   #1
Xyre
Member
 
Registered: Dec 2003
Distribution: Slackware 10
Posts: 32

Rep: Reputation: 15
Can't get m4a files to play


Alright, first, im runnign slackware 10 on kernel 2.6.7 (which i compiled myself, not pat's version) on a dell cpxh notebook.

i have a whole lot of m4a files on an smb share that i have mounted, and so far, nothing will play them except xine. i have flac installed (v1.1) and the xmms flac plugin (reference flac player 1.1, libxmms-flac.so), and neither xmms nor rhythmbox will even open the files, kaboodle will open it and play it, but i get no sound output, and xine can open and play them fine

i am using the newest alsa (compiled from source)

i have no idea whats going on, any ideas? thanks

p.s., i would prefer to play them in rhythmbox (due to its music library feature), but xmms is just as good, thanks
 
Old 07-05-2004, 03:48 PM   #2
slackMeUp
Member
 
Registered: Nov 2003
Distribution: Slack-where?
Posts: 654

Rep: Reputation: 30
m4a (aka mpeg layer 4 audio) is not related to flac. (I wish it was. . .)

m4a files are AAC files.

There is a way of playing them in XMMS. . . with a lib and a plugin, but I have yet to get this working. It seems to be kinda buggy.

What I did. . .

Download faad (it's an m4a/aac decoder.)
Use it to turn the m4a files into wav files.
Install OGG tools.
Use oggenc to encode the wave files into ogg files.
Then delete the wave and m4a files. . .
Play the ogg files in XMMS or whatever player you like.
There is little to no loss in quality.

I even wrote a script to do all the work for me.
Make sure you have faad, and oggenc programs before running this. . .
And just to be save, make a copy of the m4a files before you run this script, that way if something goes wrong you don't lose your music.

Save the text to a .sh file. (eg. "m4aConvert.sh") and run it by doing "#sh m4aConvert.sh"
So just run this in a directory that has some m4a files in it. If it is on a SMB share then you might want to copy them to your local drive first.

Code:
#!/bin/bash
old_ifs=${IFS}
IFS=$'\n'

echo =================================
echo Ripping m4a files to wave format. 
echo =================================
sleep 2
echo

for i in `ls -1t`; do
faad $i
done

echo ================================================
echo Removing m4a files + encoding wave files in OGG. 
echo ================================================
sleep 2
echo

rm *.m4a

for i in `ls -1t`; do
oggenc -q 6 $i
done

rm *.wav

echo =====
echo Done!
echo =====
What is left in the directory is just the OGG music files.
Hope this helps you.

Last edited by slackMeUp; 07-05-2004 at 03:51 PM.
 
Old 07-05-2004, 07:15 PM   #3
Xyre
Member
 
Registered: Dec 2003
Distribution: Slackware 10
Posts: 32

Original Poster
Rep: Reputation: 15
ugh, so i have to convert, oh well

the thing is, they all reside on a windows machine on the network, and organized by folder, and totalling almost 800 files

but i suppose i could find a batch converter and get them to ogg, thanks for the suggestion
 
Old 07-05-2004, 10:28 PM   #4
webvandals
Member
 
Registered: Aug 2003
Posts: 105

Rep: Reputation: 15
I also would really like to know how to get my m4a files to play in rhythmbox or juk. Converting a compressed file to another compression format is not a solution, methinks. Not only does it take a long time -- it degrades the sound quality considerably. Any other ideas?
 
Old 07-05-2004, 10:47 PM   #5
mrgrieves
Member
 
Registered: Apr 2004
Location: north of 52, south of 54
Distribution: slackware 10.0
Posts: 108

Rep: Reputation: 15
That gave me a great idea.

Sorry I'm an amateur with shell script, but will this work? Any possible improvements? Its basically a copy of a ligh media player on windows I once tried, designed to play all mp3's in a directory:
Quote:
#!/bin/bash
old_ifs=${IFS}
IFS=$'\n'

echo =================================
echo Playing MP3's in directory
echo =================================
sleep 2
echo

for i in `ls -1t`; do
madplay $i
done
 
Old 07-05-2004, 11:08 PM   #6
webvandals
Member
 
Registered: Aug 2003
Posts: 105

Rep: Reputation: 15
No offense but umm... What's that got to do with getting m4a files to play?
 
Old 07-06-2004, 01:07 AM   #7
slackMeUp
Member
 
Registered: Nov 2003
Distribution: Slack-where?
Posts: 654

Rep: Reputation: 30
Well if madplay has built in AAC support then you would be set. . . . however, the thread starter wants them to play in XMMS and/or rhythmbox. Both are not command-line apps and both offer much more control then a command-line app. . .




Oh and the convertion idea I gave was just a suggestion. . . it's what I did. . . and the ogg files sound much better then most of my MP3s.
 
Old 07-10-2004, 01:48 PM   #8
prell
Member
 
Registered: Jul 2004
Posts: 73

Rep: Reputation: 15
different script

I had some problems running that script, as a result of spaces ('\ ') and different defaults for ls on my distribution (Mandrake 10), so I wrote a more compatible/neutral script. Enjoy!

Here it is:

Code:
#!/bin/bash

echo converting m4a files to wav..

ls -1 -b --indicator-style=none *.m4a >> output.txt

xargs --max-args=1 faad < output.txt

echo encoding wavs..

rm output.txt

ls -1 -b --indicator-style=none *.wav >> output.txt

xargs --max-args=1 oggenc -q 6 < output.txt

rm *.wav

rm output.txt
 
Old 07-10-2004, 07:36 PM   #9
webvandals
Member
 
Registered: Aug 2003
Posts: 105

Rep: Reputation: 15
Oh guys! There must be a better way! As an ex audio engineer, I just can't stomach the idea of taking a reasonably well compressed audio file. decompressing it, then re-compressing it to another (slightly inferior, IMO) compression format. To me this is like taking a well-recorded hi-bias tape, making a CD from it, then recording the CD to a normal bias tape. The sound quality degrades with each step of the process.

Are you sure that Linux can't just play M4A files directly when given the proper codecs?
 
Old 07-14-2004, 10:25 AM   #10
lucabarozzi
LQ Newbie
 
Registered: Jul 2004
Posts: 1

Rep: Reputation: 0
I'm using Mdk10 and i downloaded the Penguin Liberation Front faad2-xmms plugin.
It works for me but i wasn't able to compile this plugin by myself, so thanks to PLF.

You can find the plugin here:

ftp://ftp.pcds.ch/pub/plf/mandrake/1...-4plf.i586.rpm

maybe you need these packages too

ftp://ftp.pcds.ch/pub/plf/mandrake/1...-4plf.i586.rpm
ftp://ftp.pcds.ch/pub/plf/mandrake/1...-4plf.i586.rpm

but i'm not sure (excuse me, i did it some time ago )

Try to find something analogous for slackware or try to compile the source from:

http://switch.dl.sourceforge.net/sou...ad2-2.0.tar.gz

it contains the xmms plugin.

Luca
 
Old 08-04-2004, 09:57 PM   #11
jdexter
LQ Newbie
 
Registered: Aug 2004
Distribution: SuSE 9.1 Pro
Posts: 26

Rep: Reputation: 15
slackMeUp: Thanks for the script! All I had to do was change the line:

oggenc -q 6 $i

to

lame -h $i

And now I have mp3's for use with my mp3 player with little to no noticeable change in sound quality.
 
Old 08-31-2004, 07:04 AM   #12
hans-jürgen
LQ Newbie
 
Registered: Aug 2004
Location: Hamburg, Germany
Posts: 18

Rep: Reputation: 0
Quote:
Originally posted by webvandals
Oh guys! There must be a better way!
There is...

Quote:
Are you sure that Linux can't just play M4A files directly when given the proper codecs?
Sure it can, e.g. there are AAC/MP4 plugins for XMMS and for gstreamer/gst-player which might help with the rhythmbox problem, too. See these Wiki pages on Audiocoding.com, the homepage of the open source AAC/MP4 codecs FAAC and FAAD2:

http://www.audiocoding.com/modules/wiki/?page=FAAC
http://www.audiocoding.com/modules/wiki/?page=FAAD2
http://www.audiocoding.com/modules/w...or+Linux%2FBSD
http://www.audiocoding.com/modules/w...MPEG-4+Players
 
Old 08-31-2004, 08:38 AM   #13
webvandals
Member
 
Registered: Aug 2003
Posts: 105

Rep: Reputation: 15
Aaaahhh... that's what I was waiting for :-)

Thanks!
 
Old 09-06-2004, 06:47 PM   #14
semlak
LQ Newbie
 
Registered: May 2004
Location: Illinois
Distribution: Fedora
Posts: 8

Rep: Reputation: 0
Quote:
Originally posted by hans-jürgen
There is...

Sure it can, e.g. there are AAC/MP4 plugins for XMMS and for gstreamer/gst-player which might help with the rhythmbox problem, too. See these Wiki pages on Audiocoding.com, the homepage of the open source AAC/MP4 codecs FAAC and FAAD2:

http://www.audiocoding.com/modules/wiki/?page=FAAC
http://www.audiocoding.com/modules/wiki/?page=FAAD2
http://www.audiocoding.com/modules/w...or+Linux%2FBSD
http://www.audiocoding.com/modules/w...MPEG-4+Players

I also was able to play aac files I (m4a files, I guess) in mplayer, if that helps.
 
Old 09-07-2004, 12:20 AM   #15
hans-jürgen
LQ Newbie
 
Registered: Aug 2004
Location: Hamburg, Germany
Posts: 18

Rep: Reputation: 0
Right, all Linux players based on FAAD2 are able to do this (Xine, VLC etc.), see the Wiki page about Software Audio Players. I wrote about XMMS and GStreamer/Rhythmbox, because those two were mentioned in this thread. By the way, the new Beep Media Player (forked from XMMS) also has a MP4 plugin now, see this thread on the BMP forum:

http://beepmp.sourceforge.net/forum/viewtopic.php?t=48
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can linux play M4a/mp4? love_academy Linux - Newbie 7 12-17-2008 08:20 AM
Playing M4A files in xmms eqxro Linux - Software 12 04-05-2007 02:43 AM
Rhythmbox refuses to open any m4a files dubya Fedora 2 09-23-2006 01:19 PM
Kaffeine, won't play a DVD but will play individual VOB files? GameGuru Linux - Newbie 12 07-08-2005 12:33 AM
Anyone know how to rip CD's to Tagged m4a, AAC, mp4 files? carl0ski Linux - Software 2 04-17-2005 04:41 PM


All times are GMT -5. The time now is 02:28 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration