 |
|
 |
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
|
|
|
|
 |
|
 |
Hi TyloCook,
Though I have lost interest from the article but still thanks for your comment
Did u you command line to convert your file to mp3? If you use command line to convert audio file to mp3 then use the following command line
sox test.wav test.mp3
and if you use sox in your asp.net application then simply use the following
test.wav test.mp3
I hope it will work...at least worked for me
Let me know if you have any queries...I'll help as far as I can
Thanks - Arin
Arin
Mail: arinhere@gmail.com
http://blogs.msdn.com/coding4fun/archive/2008/04/16/8399645.aspx
|
|
|
|
 |
|
 |
Yes, using the commandline sox.exe test.wav test.mp3 yields sox.exe soxio: Can't open output file `temp.mp3': SoX was compiled without MP3 encoding support.
I believe this is because of some sort of error coming from my Cmake file (listed in the first post in this thread). Does everything in there look accurate to you?
Cmake does find lame.h, because I get the following line when running it:
include files HAVE_LAME_LAME_H1 – found
However, it doesn't find lame_init.
-- Looking for lame_init in mp3lame
-- Looking for lame_init in mp3lame - not found
If Cmake can find my lame.h file, why would it not be able to find lame_init?
---------------
TyloCook
|
|
|
|
 |
|
 |
Hi tylocook,
Add me at your chat id. My id is arinhere@gmail.com
We can discuss this over there, so that it may be easy for me to understand.
Thanks
Arin
Mail: arinhere@gmail.com
http://blogs.msdn.com/coding4fun/archive/2008/04/16/8399645.aspx
|
|
|
|
 |
|
 |
Well, good news. I got it working. It seems my problem stemmed from the fact that I screwed up compiling the lib files into Debug instead of Release (I think). Linking errors were causing Cmake to not be able to find lame_init.
Also, I found an article quite similar to the one you posted here on C++'s mailing list, displayed here on google groups: http://groups.google.com/group/comp.lang.c++/browse_thread/thread/8accc7fb465753a5[^]
Your steps involving how to edit the CMakeLists.txt file were very confusing, and I had it all out of order. The Google Group article will make it more clear to anyone who happens to stumble on here.
Anyway, great job in letting me know how to compile those Libs (the Google Group didn't bother to say), and thanks for offering to help.
|
|
|
|
 |
|
 |
Yeah...actually that's the only article available for this, which is written by "Jason Smestad"....I have mentioned it earlier....but if you proceed with that...you will get some steps which are not working as it was written...that's why I have changed it in some portion to get it done right...
Anyway...happy programming
Thanks - Arin
Arin
Mail: arinhere@gmail.com
http://blogs.msdn.com/coding4fun/archive/2008/04/16/8399645.aspx
|
|
|
|
 |
|
 |
Does not belong on codeproject. Would be more appropriate on the sox website.
|
|
|
|
 |
|
 |
it just my normal thought to help some developers like me, who may be face this problem which has very little solutions available on the internet...if you guyz don't think its not the place for this article then I can't help it.....
Arin
Mail: arinhere@gmail.com
http://blogs.msdn.com/coding4fun/archive/2008/04/16/8399645.aspx
|
|
|
|
 |
|
 |
I cannot figure it out from your article - have I misunderstood some points from your descriptions?
What is the purpose of making such library build, and what could it be used for then- for building applications that can play MP3 audio files, on Windows or other OS? or what else it is?
Please provide some clarifications about it, and thanks for your efforts.
|
|
|
|
 |
|
 |
If you go through the introduction section of this article you can see that sox is an audio editing tool. Now suppose you want to build a website where user can edit audio files. Editing means like, cutting, joining multiple audio files, sound fade in, sound fade out etc. Using sox you can easily do that. Sox is completely free. So you don't have to bother about that.
Now sox don't have mp3 support and mp3 is one of the most popular format accepted. That's why its important to enable mp3 support.
The output of the process will be an exe file of sox which have mp3 support and you can use that exe in your application.
Arin
Mail: arinhere@gmail.com
http://blogs.msdn.com/coding4fun/archive/2008/04/16/8399645.aspx
|
|
|
|
 |
|
 |
This really isn't much of an article. Why would I need this? What's the point? All this shows is how to compile some OSS library. That's not really the point of CP articles.
|
|
|
|
 |
|
 |
What does it have to do with ASP.NET?
|
|
|
|
 |
|
 |
The output of the process will be an exe file of sox which have mp3 support and you can use that exe in your web application.
Arin
Mail: arinhere@gmail.com
http://blogs.msdn.com/coding4fun/archive/2008/04/16/8399645.aspx
|
|
|
|
 |