Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


Search this Thread
Old 01-19-2007, 07:47 PM   #1
Registered: Sep 2004
Location: Melbourne, Victoria Australia
Distribution: Support those that support you :)
Posts: 872
Blog Entries: 12

Rep: Reputation: 30
bash discover Audio codec used in a file


i need to find a way to either save as a variable or display the audio format/codec used by a file

The reason is so i can modify my Mplayer audio output based on whether its
ac3 or mp3/etc

AC3 works best on pass through
-ao alsa -ac hwac3
but mp3 doesnt work with the above.


if $audio==ac3
output=$("-ao alsa -ac hwac3")
"Disover what audio codec is- choose output" ; mplayer -fs $output /media/Movie

Last edited by carl0ski; 01-19-2007 at 07:50 PM.
Old 01-19-2007, 07:50 PM   #2
Senior Member
Registered: Jul 2005
Distribution: Slackware
Posts: 2,014

Rep: Reputation: 115Reputation: 115
Try "file" to invoke your filetype magic recognition. May require some new entries in your magic file to work.


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Audio Codec Issue? wh33t General 0 10-07-2005 02:25 AM
MPlayer unable to find appropriate audio codec for avi file hbbtstar Linux - Software 1 05-23-2005 05:51 PM
Installing Audio Codec hitman_et Linux - General 3 12-12-2004 10:07 AM
Trouble with audio codec Dare Linux - Software 1 05-02-2004 05:05 PM
ac97 audio codec shini Linux - Software 3 08-18-2003 01:44 AM

All times are GMT -5. The time now is 03:19 AM.

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