 |
|
 |
I had to add to this sox.exe build folder the runtime library: msvcr71.dll
Deploying in a windows server 2008 and running sox.exe there is a error saying this dll is missed, you can also copy this file to Windows\System32 folder if you have permission.
AUS Enrique Ferreyra
(Pachu)
|
|
|
|
 |
|
 |
Hello, thank you for posting this, i had to solve a simple thing: extract first 30 secs of mp3 files and downgrade (resample) to 22khz this builds solve that in 1 simple command line call:
sox test.mp3 -r 22k test30.mp3 trim 0 30
AUS Enrique Ferreyra
(Pachu)
|
|
|
|
 |
|
 |
You sox.exe from sox.zip works.
I'm just add file msvcr71.dll in sox.exe directory.
It works under Windows 7.
I'm test wav -> mp3, wav -> raw.
|
|
|
|
 |
|
 |
Totally awesome! Thank you
|
|
|
|
 |
|
 |
Even if you get Sox working with mp3 support, while reading mp3s seems to work fine, you can't set key output mp3 options like bitrate, stereo mode, quality/speed, etc, from the command line. They are chosen automatically. Unless you know how to extend Sox's command line to accept these options, you have to decide the mp3 output format you want, then hardcode it into the exe by reading lame.h to see what function calls you need, then calling them in sox_mp3startwrite() in mp3.c.
For example, in sox_mp3startwrite() in mp3.c, under
lame_set_in_samplerate(p->gfp,(int)ft->signal.rate);
you can add
lame_set_brate(p->gfp,256);
lame_set_mode(p->gfp,1);
lame_set_quality(p->gfp,0);
to set the bitrate to 256, the stereo mode to joint stereo, and the quality to 0.
This applies to Sox 14.0.1. Though I could get later versions to build using this article, they wouldn't recognize mp3 as a supported file type.
modified on Wednesday, July 29, 2009 8:08 PM
|
|
|
|
 |
|
 |
Sox supports everything you mentioned over here...bitrate, stereo mode etc. For more information check various sox command line...
Thanks - Arin
Arin
Mail: arinhere@gmail.com
http://blogs.msdn.com/coding4fun/archive/2008/04/16/8399645.aspx
|
|
|
|
 |
|
 |
Hi, i have build sox.exe with mp3 support.
On computer i build, it run ok but when i copy sox.exe
and try to run on other computer, i get an error.
Something like this:
Initialization failed .... re-install may fix problem.
Do i need deploy other files with sox.exe?
Thanks a lot
|
|
|
|
 |
|
 |
Hello,
Please check the attached files with the article. I have uploaded sox.zip. Download the zip file and use sox.exe.
Thanks - Arin
P.S: rate this article if its helps you.
Arin
Mail: arinhere@gmail.com
http://blogs.msdn.com/coding4fun/archive/2008/04/16/8399645.aspx
|
|
|
|
 |
|
 |
Hi, how do i build limbad?
There is no sln file like lame.
Thanks
|
|
|
|
 |
|
 |
Follow the step 2 to build libmad....
Arin
Mail: arinhere@gmail.com
http://blogs.msdn.com/coding4fun/archive/2008/04/16/8399645.aspx
|
|
|
|
 |
|
 |
Hi could you send me compiled binaries (or upload ones on code project)?
This is because actually I am not a programmer and I do nothing about C++ compilation. But I need sox with mp3 support very much.
Thank you!
Igor Polonsky.
|
|
|
|
 |
|
 |
Me too !!!
Please.
Thanks
|
|
|
|
 |
|
 |
Hello,
Please check the attached files with the article. I have uploaded sox.zip. Download the zip file and use sox.exe.
Thanks - Arin
P.S: rate this article if its helps you.
Arin
Mail: arinhere@gmail.com
http://blogs.msdn.com/coding4fun/archive/2008/04/16/8399645.aspx
|
|
|
|
 |
|
 |
Hi - Sox version 14.3 has a useful function called Voice Audio Detection. I would be extremely grateful if you could update the sox.zip to include version 14.3.
|
|
|
|
 |
|
 |
Hi,
Thanks for the article. It is really helpfull. Ignore the messages from people that state otherwise. You have my 5.
Can you please tell me if it is possible to compile the 14.0.2 version of SoX that way? And is it also possible to compile it with FFMPEG libraries and how?
Best regards,
X3m
|
|
|
|
 |
|
 |
Hello X3m,
Yes, 14.0.2 can be compiled like this way. Give it a try, it should be compiled and about FFMPEG, I have heard that Sox can be compiled with FFMPEG, but haven't tried it.
If you do it then please let me know.
Thanks and Regards - Arin
Arin
Mail: arinhere@gmail.com
http://blogs.msdn.com/coding4fun/archive/2008/04/16/8399645.aspx
|
|
|
|
 |
|
 |
while building lame...make sure the in the debug/release dropdown on the toolbar 'Lame Release' is selected.
for libmad it should be 'Release'.
...................................
The cmakelists is hard to implement so here is the core part
if (NOT HAVE_LAME_LAME_H)
optional(HAVE_LAME_LAME_H lame.h mp3lame lame_init mp3)
endif (NOT HAVE_LAME_LAME_H)
optional(HAVE_SAMPLERATE_H samplerate.h samplerate src_simple rabbit)
optional(HAVE_SNDFILE_H sndfile.h sndfile sf_open sndfile)
optional(HAVE_SNDFILE_1_0_12 sndfile.h sndfile sf_open_virtual "")
optional(HAVE_SUN_AUDIOIO_H sun/audioio.h c ioctl sunaudio)
if (NOT HAVE_SUN_AUDIOIO_H)
optional(HAVE_SYS_AUDIOIO_H sys/audioio.h c ioctl sunaudio)
endif (NOT HAVE_SUN_AUDIOIO_H)
optional(HAVE_SYS_SOUNDCARD_H sys/soundcard.h c ioctl oss)
if (NOT HAVE_SYS_SOUNDCARD_H)
optional(HAVE_MACHINE_SOUNDCARD_H machine/soundcard.h ossaudio _oss_ioctl oss)
endif (NOT HAVE_SYS_SOUNDCARD_H)
optional3(HAVE_OGG_VORBIS vorbis/codec.h vorbis vorbis_analysis_headerout vorbisfile ov_clear vorbisenc vorbis_encode_init_vbr vorbis)
optional3(HAVE_FFMPEG ffmpeg/avformat.h avformat av_open_input_file avutil av_rescale_q avcodec avcodec_decode_audio2 ffmpeg)
subdirs(src lpc10)
......................................
Also dont forget:
* Do the same for sox after that Linker -> Input -> Additional Dependencies -> click on “…” button -> after the last line add mpglib.lib
otherwise there'll be no mp3 support...hell worked hard on this..
============================
Thanx Arin, youre great .
=========================
|
|
|
|
 |
|
 |
Hi Bharat,
Thanks for that update....and thanks for the comment too...but all credits goes to Justin....he is the one who have successfully done this for the first time...I have just made few modifications and published it..that's all...
Thanks
Arin
Mail: arinhere@gmail.com
http://blogs.msdn.com/coding4fun/archive/2008/04/16/8399645.aspx
|
|
|
|
 |
|
 |
Do you have any idea on how to compile sox with other additional libraries under windows? I basically need support for amr-nb and amr-wb..
|
|
|
|
 |
|
 |
You have to find out the open source project which provides the support for those formats. If you get the binary of the project then it can be compiled.
Arin
Mail: arinhere@gmail.com
http://blogs.msdn.com/coding4fun/archive/2008/04/16/8399645.aspx
|
|
|
|
 |
|
 |
Can you please post the built project for Windows XP.
Thanks in advance
|
|
|
|
 |
|
 |
You are missing a pretty important $-character which makes CMakeList unable to find lame_init. CMakeLists.txt should look like:
...
endif(NEED_LIBM)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} mpglib)
optional(HAVE_LAME_LAME_H lame.h mp3lame lame_init mp3)
optional(EXTERNAL_GSM gsm/gsm.h gsm gsm_create "")
...
You could also just place all the .lib and .h files in the same directory if you are lazy. Makes no difference. For example:
Indhold af F:\SOX
03-04-2009 17:05 <DIR> .
03-04-2009 16:05 <DIR> ..
03-04-2009 17:22 45.950 gsm.lib
03-04-2009 17:43 <DIR> lame-3.97
24-09-2006 19:23 40.525 lame.h
03-04-2009 17:14 <DIR> libmad-0.15.1b
17-02-2004 08:25 27.125 mad.h
03-04-2009 17:19 144.810 mad.lib
03-04-2009 17:43 423.584 mp3lame.lib
03-04-2009 17:19 84.094 mpglib.lib
03-04-2009 17:49 <DIR> sox-14.0.1
6 fil(er) 766.088 byte
IF CMake mucks up, just delete CMakeCache.txt and run cmake again.
Also, when compiling each .lib, you must first select 'Release' build and then chose /MD (multi-threaded DLL) as runtime link library. (Note to VS newbies - don't select /MD first and then change to 'Release' because each release configuration has its own set of settings, so that'd just load some default settings again). If just a single library is not /MD you get conflicts when linking sox because each runtime library exports the same set of function names.
I've precompiled it and placed it at www.quicklz.com/pjok/sox.exe
|
|
|
|
 |
|
 |
The link you provided for the executable is dead. What all formats does your your binary suport?
|
|
|
|
 |
|
 |
Man am I glad you wrote this. I need to do just this in order to convert an IMA-ADPCM wav file into an MP3 (Something lame alone doesn't accept as valid input).
However, I am running into some problems. All is well with the location of my lib and .h files. They are located:
lameforsox/lame/lame.h
lameforsox/mp3lame.lib
lameforsox/mpglib.lib
madforsox/mad/mad.h
madforsox/mad.lib
I also made sure that Visual Studio is looking in the respective folders for these files.
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
First of all, I am getting this during the Cmake step:
-- Looking for lame_init in mp3lame
-- Looking for lame_init in mp3lame - not found
Here are what I believe to be the relevant lines for my Cmake file. Bold lines mean it is a line I added or edited.
...
if(NEED_LIBM)
set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} -lm)
set(CMAKE_REQUIRED_LIBRARIES {CMAKE_REQUIRED_LIBRARIES} mpglib)
optional(HAVE_LAME_LAME_H lame/lame.h mp3lame lame_init mp3)
endif(NEED_LIBM)
optional(EXTERNAL_GSM gsm/gsm.h gsm gsm_create "")
optional(HAVE_ALSA alsa/asoundlib.h asound snd_pcm_open alsa)
optional(HAVE_AMRNB amrnb/sp_dec.h amrnb Decoder_Interface_init amr-nb)
optional(HAVE_AMRWB amrwb/dec.h amrwb D_IF_init amr-wb)
optional(HAVE_ID3TAG id3tag.h id3tag id3_file_open "")
optional(HAVE_LIBAO ao/ao.h ao ao_play ao)
optional(HAVE_FLAC FLAC/all.h FLAC FLAC__stream_encoder_new flac)
optional(HAVE_MAD_H mad.h mad mad_stream_buffer mp3)
optional(HAVE_LAME_LAME_H lame.h mp3lame lame_init mp3)
if (NOT HAVE_LAME_LAME_H)
optional(HAVE_LAME_LAME_H lame.h mp3lame lame_init mp3)
endif (NOT HAVE_LAME_LAME_H)
...
---------------
TyloCook
|
|
|
|
 |
|
 |
Hm, I was so excited to post that I forgot to finish my thought!
Whenever I finally get everything built, sox.exe -h reveals that mp3 and mp2 are supported. However, when attempting to convert a file to MP3, it tells me: sox.exe soxio: Can't open output file `temp.mp3': SoX was compiled without MP3 encoding support.
I believe it is this lame_init not being found that is the culprit.
Any advice?
---------------
TyloCook
|
|
|
|
 |