Skip to main content
GameDev.net gamedev.net
🔒 Locked

Command-Line Audio Conversion Utility?

Started by Extrarius Aug 18, 2007 at 1:02 PM 5 replies 8.6k views
Original Post
Extrarius
Extrarius
I'm trying to mass-convert quite a few audio files from mp3 to speex. Unfortunately, "speexenc" only supports reading wav files, and the only other audio conversion program I've found, "sox", requires recompiling it for mp3 support (and I can't find any info on compiling the windows version at all, nor whether the required library exist for windows). I don't mind a multistep process, I just need something I can easily automate. If there is to be a middile step (mp3 to wav to speex), I need to ensure the intermediate file is a 16 bit 16KHz PCM wav file for maximum quality. Any help would be greatly appreciated.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Ravuya
Ravuya
Even if it's not a command line, Audacity has a "batch conversion" mode which can do up a whole directory at once. And it runs on Linux, OS X and Windows, so no real worries there.

I wouldn't be surprised if it had a command line interface hidden somewhere within it, though.

I do not, however, know if Audacity supports Speex.
Extrarius
Extrarius
Quote:
Original post by Ravuya
Even if it's not a command line, Audacity has a "batch conversion" mode which can do up a whole directory at once.[...]
I use Audacity now to convert manually to wav, but its batch conversion is not an option because it doesn't offer an option to change the output sample rate (I have to manually change the 'Project Rate', which overides the preference I set for 16KHz). Also, I need command-line because the conversion isn't the only thing going on in the hopefully-soon-to-be automatic process, it's just the only part I'm having problems with.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Extrarius
Extrarius
Quote:
Original post by Richy2k
SoX! http://sox.sourceforge.net/
I don't know if it supports speex though.
It doesn't support mp3 without special compilation, and there are no instructions for such compilation. The windows binaries they provide do not have that compile-time option enabled.

If I could obtain windows binaries with such support, I could use sox for mp3->wav and speexenc for wav->speex which would be perfect.
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Gage64
Gage64
There are several programs here that you might find helpful (even though they are not command-line programs).

EDIT:

Quote:
I can't find any info on compiling the windows version at all, nor whether the required library exist for windows


Maybe some of the links here will help you (especially this one).

[Edited by - Gage64 on August 18, 2007 3:34:33 PM]
Oralloy
Oralloy

Mplayer should be able to do the conversion too wav at the very least (no idea if it can encode to speex).
mplayer -ao pcm input.mp3 -ao pcm:file="outfile.wav"


I've no idea about the format of the wavs produced. No doubt there is an option but unfortunately the mlayer documentation tends to go over my head.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.