编译安装SOX

1下载(MAC OS)

   http://sox.sourceforge.net/

   注意:把源代码放在英文目录下,否则可能会出现编译不过的问题;

 

2编译

  autoreconf -i                   -----源码中的configure.ac 会生成configure

  ./configure                       -----生成makefile

  automake --addmissing    
  make

      make install                        生成可执行程序和SOX动态/静态库

这个是我自己编译的makefile: 里边会有依赖其他库,如果用,记得改user的名字;sox-Makefile-副本.txt.zip

3安装附加库

参考:https://audiodigitale.eu/?p=25

brew install opencore-amr libao flac two-lame libtool mad libid3tag libmagic libvorbis libpng libsndfile wavpack lame

 

OpencoreAMR-NB/WB http://sourceforge.net/projects/opencore-amr
AMR-NB/WB http://www.penguin.cz/~utx/amr
AO http://xiph.org/ao
FLAC http://flac.sourceforge.net
LADSPA http://www.ladspa.org
Lame MP3 encoder http://lame.sourceforge.net
Twolame MP2 enc. http://www.twolame.org
libltdl http://www.gnu.org/software/libtool
MAD MP3 decoder http://www.underbit.com/products/mad
MP3 ID3 tags https://sourceforge.net/projects/mad/files/libid3tag/
Magic http://www.darwinsys.com/file
Ogg Vorbis http://www.vorbis.com
Opus http://www.opus-codec.org/
PNG http://www.libpng.org/pub/png zlib
Sndfile http://www.mega-nerd.com/libsndfile
WavPack http://www.wavpack.com

 

 4 安装过程用到的一些编译工具:

   (4.1) auto-archive(某些编译选项识别不了,譬如:AX_APPEND_COMPILE_FLAGS(-fstack-protector)无法识别),glibtool(出现没有libtoolize的问题), autoconfig 等,根据编译错误,查询需要安装的编译工具

   (4.2)编译的时候还可能遇到找不到vorbis头文件,根据错误看,ogg是能找到的,这个时候你可以把安装目录【你用brew安装vorbis到哪里,就去哪里找】下的vorbis的lib文件夹下的头文件先复制到ogg的头文件夹下,让编译能找到;

  (4.3) 出现required file `build/ltmain.sh' not found 的时候,因为MAC没有libtoolize,可能需要你用glibtool ,运行下边的命令添加软连接

    brew install libtool  或者  brew install glibtool
    ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize

(4.4)auto config过程会提示你输入:automake --add-missing ,直接输入就好;

5 安装过程中出现configure编译不过:

   找到编译不过的选项,酌情考虑,不影响功能的,可以先删除;

6 如果你想用SOX的动态库/静态库,自己又实在编译不出来

   brew install sox

   brew info sox

   找到安装目录,安装目录下有SOX的EXE还有动态库,静态库,你可以直接拿去用;(Mac M1 ) 

   注意:使用sox.3的时候发现还需要添加其他库,找到brew的安装目录,opt/brew/celler***好像是,把需要用的dylib拷出来

                                


 

7官网能力集

The current release handles the following audio file formats:

  • Raw files in various binary formats
  • Raw textual data
  • Amiga 8svx files
  • Apple/SGI AIFF files
  • SUN .au files
    • PCM, u-law, A-law
    • G7xx ADPCM files (read only)
    • mutant DEC .au files
    • NeXT .snd files
  • AVR files
  • CDDA (Compact Disc Digital Audio format)
  • CVS and VMS files (continuous variable slope)
  • Grandstream ring-tone files
  • GSM files
  • HTK files
  • LPC-10 files
  • Macintosh HCOM files
  • Amiga MAUD files
  • AMR-WB & AMR-NB (with optional libamrwb & libamrnb libraries)
  • MP2/MP3 (with optional libmad, libtwolame and libmp3lame libraries)
  • MP4, AAC, AC3, WAVPACK, AMR-NB files (with optional ffmpeg library)
  • AVI, WMV, Ogg Theora, MPEG video files (with optional ffmpeg library)
  • Ogg Vorbis files (with optional Ogg Vorbis libraries)
  • FLAC files (with optional libFLAC)
  • IRCAM SoundFile files
  • NIST SPHERE files
  • Turtle beach SampleVision files
  • Sounder & Soundtool (DOS) files
  • Yamaha TX-16W sampler files
  • SoundBlaster .VOC files
  • Dialogic/OKI ADPCM files (.VOX)
  • Microsoft .WAV files
    • PCM, floating point
    • u-law, A-law, MS ADPCM, IMA (DMI) ADPCM
    • GSM
    • RIFX (big endian)
  • WavPack files (with optional libwavpack library)
  • Psion (palmtop) A-law WVE files and Record voice notes
  • Maxis XA Audio files
    • EA ADPCM (read support only, for now)
  • Pseudo formats that allow direct playing/recording from most audio devices
  • The "null" pseudo-file that reads and writes from/to nowhere

The audio effects/tools included in this release are as follows:

 
  • Tone/filter effects
    • allpass: RBJ all-pass biquad IIR filter
    • bandpass: RBJ band-pass biquad IIR filter
    • bandreject: RBJ band-reject biquad IIR filter
    • band: SPKit resonator band-pass IIR filter
    • bass: Tone control: RBJ shelving biquad IIR filter
    • equalizer: RBJ peaking equalisation biquad IIR filter
    • firfit+: FFT convolution FIR filter using given freq. response (W.I.P.)
    • highpass: High-pass filter: Single pole or RBJ biquad IIR
    • hilbert: Hilbert transform filter (90 degrees phase shift)
    • lowpass: Low-pass filter: single pole or RBJ biquad IIR
    • sinc: Sinc-windowed low/high-pass/band-pass/reject FIR
    • treble: Tone control: RBJ shelving biquad IIR filter
     
  • Production effects
    • chorus: Make a single instrument sound like many
    • delay: Delay one or more channels
    • echo: Add an echo
    • echos: Add a sequence of echos
    • flanger: Stereo flanger
    • overdrive: Non-linear distortion
    • phaser: Phase shifter
    • repeat: Loop the audio a number of times
    • reverb: Add reverberation
    • reverse: Reverse the audio (to search for Satanic messages ;-)
    • tremolo: Sinusoidal volume modulation
     
  • Volume/level effects
    • compand: Signal level compression/expansion/limiting
    • contrast: Phase contrast volume enhancement
    • dcshift: Apply or remove DC offset
    • fade: Apply a fade-in and/or fade-out to the audio
    • gain: Apply gain or attenuation; normalise/equalise/balance/headroom
    • loudness: Gain control with ISO 226 loudness compensation
    • mcompand: Multi-band compression/expansion/limiting
    • norm: Normalise to 0dB (or other)
    • vol: Adjust audio volume
     
  • Editing effects
    • pad: Pad (usually) the ends of the audio with silence
    • silence: Remove portions of silence from the audio
    • splice: Perform the equivalent of a cross-faded tape splice
    • trim: Cuts portions out of the audio
    • vad: Voice activity detector
     
  • Mixing effects
    • channels: Auto mix or duplicate to change number of channels
    • divide+: Divide sample values by those in the 1st channel (W.I.P.)
    • remix: Produce arbitrarily mixed output channels
    • swap: Swap stereo channels
     
  • Pitch/tempo effects
    • bend: Bend pitch at given times without changing tempo
    • pitch: Adjust pitch (= key) without changing tempo
    • speed: Adjust pitch & tempo together
    • stretch: Adjust tempo without changing pitch (simple alg.)
    • tempo: Adjust tempo without changing pitch (WSOLA alg.)
     
  • Mastering effects
    • dither: Add dither noise to increase quantisation SNR
    • rate: Change audio sampling rate
     
  • Specialised filters/mixers
    • deemph: ISO 908 CD de-emphasis (shelving) IIR filter
    • earwax: Process CD audio to best effect for headphone use
    • noisered: Filter out noise from the audio
    • oops: Out Of Phase Stereo (or `Karaoke') effect
    • riaa: RIAA vinyl playback equalisation
     
  • Analysis `effects'
    • noiseprof: Produce a DFT profile of the audio (use with noisered)
    • spectrogram: graph signal level vs. frequency & time (needs `libpng')
    • stat: Enumerate audio peak & RMS levels, approx. freq., etc.
    • stats: Multichannel aware `stat'
     
  • Miscellaneous effects
    • ladspa: Apply LADSPA plug-in effects e.g. CMT (Computer Music Toolkit)
    • synth: Synthesise/modulate audio tones or noise signals
    • newfile: Create a new output file when an effects chain ends.
    • restart: Restart 1st effects chain when multiple chains exist.
     
  • Low-level signal processing effects
    • biquad: 2nd-order IIR filter using externally provided coefficients
    • downsample: Reduce sample rate by discarding samples
    • fir: FFT convolution FIR filter using externally provided coefficients
    • upsample: Increase sample rate by zero stuffing
     
    + Experimental or incomplete effect; may change in future.

Multiple audio files can be combined (and then further processed with effects) using any one of the following combiner methods:

 
  • concatenate
  • mix
  • merge: E.g. two mono files to one stereo file
  • sequence: For playing multiple audio files/streams

posted on 2022-09-07 11:18  邗影  阅读(558)  评论(0编辑  收藏  举报

导航