LinuxQuestions.org
Help answer threads with 0 replies.
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
  Search this Thread
Old 11-14-2010, 09:03 PM   #1
punt
Member
 
Registered: Jun 2001
Distribution: Fedora 22
Posts: 371

Rep: Reputation: 30
Audio converter on the command line?


I discovered the world of video game music. Most of them are in .mod and .xm format. I want to be able to convert them via the command line to .mp3 so that I can play them on my iPod. Anyone know a good tool that does this?
 
Old 11-14-2010, 09:36 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 15,767
Blog Entries: 27

Rep: Reputation: 4629Reputation: 4629Reputation: 4629Reputation: 4629Reputation: 4629Reputation: 4629Reputation: 4629Reputation: 4629Reputation: 4629Reputation: 4629Reputation: 4629
You might try ffmpeg or mencoder, both of which are command line tools.

This Wikipedia article says that ffmpeg supports *.mod and gives a sample command.
 
Old 11-14-2010, 09:39 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
You might want to look at one of these programs: http://woolyss.com/tracking-trackers.php?s=Linux
Many of them will import a .mod or .xm file and export a WAV file. You could convert a wav file to mp3 using sox, ffmpeg or mencoder or audacity. These aren't command line programs. However, you might want to try calling one from the command line with --help. Sometimes a graphical program can be used from the command line. For example, you can use acroread to convert pdfs to postscript files from the command line.

It could be that sox or ffmpeg can convert .mod files, but the manpages, and `ffmpeg -formats' didn't list these formats. Search your package manager for programs to play mod files. A program like mplayer can save the output to a file in .wav format. Other players may be able to do the same.

Last edited by jschiwal; 11-14-2010 at 09:46 PM.
 
Old 11-14-2010, 09:59 PM   #4
punt
Member
 
Registered: Jun 2001
Distribution: Fedora 22
Posts: 371

Original Poster
Rep: Reputation: 30
Thanks Frank and jschiwal. It already seems complicated. I've been running "make" on ffmpeg for the past 20 minutes so I hope that works. (I'm disappointed it's not available via yum.)

I don't mind converting from .xm/.mod to .wav and then from .wav to .mp3, but the command line is a must for me since I never use X at all. The tracker solution might work, but I would like to know definitively which one does what I need rather than experimenting with apps to find a decent CLI feature set.

We'll see what happens with ffmpeg; if that fails, mencoder might be a good solution. Audacity is a decent app, but it's GUI, right?

If anyone has specific experience with any of the aforementioned tools, please let me know how you do it!
 
Old 11-14-2010, 10:11 PM   #5
punt
Member
 
Registered: Jun 2001
Distribution: Fedora 22
Posts: 371

Original Poster
Rep: Reputation: 30
Still trying.

ffmpeg results for *.xm (assuming my syntax is correct)

Code:
# ffmpeg -i 'song1.xm' -acodec copy - acodec ac3 -ab 384k song1.mp3 -acodec mp2 -ab 192k -newaudio
FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
  built on Nov 14 2010 21:58:45 with gcc 4.5.1 20100924 (Red Hat 4.5.1-4)
  configuration: 
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.11. 0 /  0.11. 0
song1.xm: Invalid data found when processing input
ffmpeg results for *.mod:

attempt #1 with first file -

Code:
# ffmpeg -i boing.mod -acodec copy - acodec ac3 -ab 384k boing.mp3 -acodec mp2 -ab 192k -newaudio
FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
  built on Nov 14 2010 21:58:45 with gcc 4.5.1 20100924 (Red Hat 4.5.1-4)
  configuration: 
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.11. 0 /  0.11. 0
boing.mod: Invalid data found when processing input
attempt #2 with another file:


Code:
# ffmpeg -i filek.mod -acodec copy - acodec ac3 -ab 384k filek.mp3 -acodec mp2 -ab 192k -newaudio
FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
  built on Nov 14 2010 21:58:45 with gcc 4.5.1 20100924 (Red Hat 4.5.1-4)
  configuration: 
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.72. 2 / 52.72. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.11. 0 /  0.11. 0
[NULL @ 0x9e7d420]Format detected only with low score of 1, misdetection possible!
[aac @ 0x9e7e600]channel element 3.6 is not allocated
[aac @ 0x9e7e600]More than one AAC RDB per ADTS frame is not implemented. Update your FFmpeg version to the newest one from SVN. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x9e7e600]Error decoding AAC frame header.
[aac @ 0x9e7d420]Could not find codec parameters (Audio: aac, 44100 Hz, stereo, s16, 958 kb/s)
[aac @ 0x9e7d420]Estimating duration from bitrate, this may be inaccurate
filek.mod: could not find codec parameters
That's slightly promising, but if it's not going to convert .xm files (a higher priority), I'm not sure it's the right app for the job.
 
Old 11-14-2010, 10:40 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
Don't use "acodec copy". That is for duplicating the audio steam into the output container. If the container doesn't support that stream, it won't work. You also have a space before the second -acodec argument. Settle on one codec to use, and use compatible bitrate and frame rate parameters. You said you wanted to produce mp3 files:

ffmpeg -i filek.mod -f mp3 -acodec libmp3lame -ab 256000 -ar 48000 -y filek.mp3

An aac stream is another option. The mp2 codec is what you would use for mpeg videos.

I don't believe that my version of ffmpeg supports either .mod or .xm files.
Try running "ffprobe <filename>" to see if the format is detected.

I did find a program called Gmodplay. I don't know if it can export as well, buy you might want to look for it on sourceforge. Also, this wiki on Linux audio may be useful as well locating linux utilities.
http://wiki.linuxaudio.org/wiki/start

Last edited by jschiwal; 11-14-2010 at 11:30 PM.
 
Old 11-23-2010, 12:18 AM   #7
punt
Member
 
Registered: Jun 2001
Distribution: Fedora 22
Posts: 371

Original Poster
Rep: Reputation: 30
Just an update - I never got this working. I didn't find a good enough script and decided to do this via Windows where I found a decent app. Bummer.
 
  


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
Red Hat - Text to Speach Converter - Command Line Tool cgtueno Linux - Software 5 08-19-2008 08:18 AM
PPT to HTML Converter? for Linux Command Line caged Linux - Software 1 05-11-2007 01:06 PM
Command Line CD Audio dtjohnst Linux - Software 3 02-25-2007 05:47 PM
command line audio control Nivram Debian 1 09-01-2006 12:55 PM
how to burn audio cd from command line rip Linux - Software 2 05-15-2003 12:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:55 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration