LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 01-19-2007, 07:47 PM   #1
carl0ski
Member
 
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


Hi

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
Code:
-ao alsa -ac hwac3
but mp3 doesnt work with the above.

basically


Code:
if $audio==ac3
then
output=$("-ao alsa -ac hwac3")
else
output=$("")
done
"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
tuxdev
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.
 
  


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


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
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