・2017/12/01
Raspberry Piで MP3対応の最新版の Sox Sound eXchange v14.4.2をビルドする方法
(ラズパイで Sox Sound eXchange MP3対応の最新版をコンパイルする方法)
Tags: [Raspberry Pi], [電子工作]
● Raspberry Pi 3 Model Bを遂に購入
Raspberry Pi3 Model B RPI2 RPI3
大人気の CPUボードの Raspberry Piに WiFiと Bluetoothが搭載されたモデルが新発売となりました。
以前から Raspberry Pi 2を買おうかどうか迷っていましたが、Raspberry Pi 3 Model Bの発売を機に購入を決意してラズベリアンになる事にしました。
※ ラズパイの OS Raspbianはバージョンが上がる毎に過去の版と OSの内部の作りが変わり、過去に書かれた製作記事(例えば Raspbian Wheezyの時代の記事)がそのままではエラーが出たりして動かない事が有ります。
※ 当方のホームページのラズパイ記事は全て Raspberry Pi 3 Model Bと Raspbian Jessieの組み合わせで動作確認をしております。
(ただし、将来的に新しい Raspbian OSが出た場合に、当方の Raspbian Jessieを基にした内容がそのままでは動かない可能性が有ります。)
※ 2017/08/16から Raspbian OSは Raspbian Jessieから Raspbian Stretchに変わりました。
※ 2019/06/20から Raspbian OSは Raspbian Stretchから Raspbian Busterに変わりました。
Download Raspbian for Raspberry Pi
ちなみに、歴代のバージョンと名称は
Debian | コードネーム | 年月 | 備考 | (参考)Ubuntuでの該当名称 |
Debian 11 | Bullseye | 2021/08/14~ | 2021/11からラズパイにリリース | Focal Fossa 20.04 LTS ? |
Debian 10 | Buster | 2019/06/20~ | 2019/06からラズパイ4対応 | Bionic 18.04 LTS |
Debian 9 | Stretch | 2017/08/16~ | 2018/03からラズパイ3B+対応 | Xenial 16.04 LTS |
Debian 8 | Jessie | 2015~ | 2016/02からラズパイ3対応 | Trusty 14.04 LTS |
Debian 7 | Wheezy | 2013~2016 | | |
Debian 6.0 | Squeeze | 2011~2014 | | |
Debian GNU/Linux 5.0 | Lenny | 2009~2012 | | |
● SoXのソースコードからコンパイルしてバイナリを作成してみる(伏線)
sudo apt-get install soxでインストールした Sound eXchangeにはライセンスの関係で MP3機能が有りません。
MP3に対応した SoXは自前でコンパイルして作成する必要が有ります。
オーディオ形式のファイル変換アプリの SoXをコンパイルします。
SoX - Sound eXchange
SoX is a cross-platform (Windows, Linux, MacOS X, etc.) command line utility that can convert various formats of computer audio files in to other formats. It can also apply various effects to these sound files, and, as an added bonus, SoX can play and record audio files on most platforms.
sudo apt-get update
cd
mkdir SOX
cd SOX
# SoX - Sound eXchange
# http://sox.sourceforge.net/
wget https://jaist.dl.sourceforge.net/project/sox/sox/14.4.2/sox-14.4.2.tar.bz2
tar xvf sox-14.4.2.tar.bz2
# MAD: MPEG Audio Decoder
# https://www.underbit.com/products/mad
wget https://jaist.dl.sourceforge.net/project/mad/libmad/0.15.1b/libmad-0.15.1b.tar.gz
tar xvf libmad-0.15.1b.tar.gz
# FLAC - Free Lossless Audio Codec
# http://flac.sourceforge.net
wget https://ftp.osuosl.org/pub/xiph/releases/flac/flac-1.3.2.tar.xz
tar xvf flac-1.3.2.tar.xz
# Vorbis.com - Ogg Vorbis
# http://www.vorbis.com
wget http://downloads.xiph.org/releases/ogg/libogg-1.3.3.tar.xz
tar xvf libogg-1.3.3.tar.xz
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.xz
tar xvf libvorbis-1.3.5.tar.xz
# Opus Interactive Audio Codec
# http://www.opus-codec.org/comparison/
# wget https://archive.mozilla.org/pub/opus/opus-1.2.1.tar.gz
# tar xvf opus-1.2.1.tar.gz
# Sound eXchange SoXを MP3に対応させる
# The LAME Project - Hhigh quality MP3 encoder
# http://lame.sourceforge.net
wget https://jaist.dl.sourceforge.net/project/lame/lame/3.100/lame-3.100.tar.gz
tar xvf lame-3.100.tar.gz
#-----------------------
mkdir tmp
SOX_CPPFLAGS=""
SOX_LDFLAGS=""
SOX_WITH=""
mkdir tmp/libmad
cd libmad-0.15.1b
# gcc: error: unrecognized command line option '-fforce-mem'; did you mean '-fforce-addr'?
# $ grep "\-fforce-mem" configure
# optimize="$optimize -fforce-mem"
sed -i '/-fforce-mem/d' configure
./configure --enable-static --disable-shared --prefix=$(realpath ../tmp/libmad)
make && make install
SOX_CPPFLAGS="$SOX_CPPFLAGS -I$(realpath ../tmp/libmad/include)"
SOX_LDFLAGS="$SOX_LDFLAGS -L$(realpath ../tmp/libmad/lib)"
SOX_WITH="$SOX_WITH --with-mad"
cd ..
#-----------------------
mkdir tmp/flac
cd flac-1.3.2
./configure --enable-static --disable-shared --prefix=$(realpath ../tmp/flac)
make && make install
SOX_CPPFLAGS="$SOX_CPPFLAGS -I$(realpath ../tmp/flac/include)"
SOX_LDFLAGS="$SOX_LDFLAGS -L$(realpath ../tmp/flac/lib)"
SOX_WITH="$SOX_WITH --with-flac"
cd ..
#-----------------------
mkdir tmp/lame
cd lame-3.100
./configure --enable-static --disable-shared --prefix=$(realpath ../tmp/lame)
make && make install
SOX_CPPFLAGS="$SOX_CPPFLAGS -I$(realpath ../tmp/lame/include)"
SOX_LDFLAGS="$SOX_LDFLAGS -L$(realpath ../tmp/lame/lib)"
SOX_WITH="$SOX_WITH --with-lame"
cd ..
#-----------------------
# mkdir tmp/opus
# cd opus-1.2.1
# ./configure --enable-static --disable-shared --prefix=$(realpath ../tmp/opus)
# make && make install
# cd ..
# wget https://archive.mozilla.org/pub/opus/opus-tools-0.1.10.tar.gz
# tar xvf opus-tools-0.1.10.tar.gz
# cd opus-tools-0.1.10
# ./configure --enable-static --disable-shared --prefix=$(realpath ../tmp/opus)
#-----------------------
mkdir tmp/libogg
cd libogg-1.3.3
./configure --enable-static --disable-shared --prefix=$(realpath ../tmp/libogg)
make && make install
SOX_CPPFLAGS="$SOX_CPPFLAGS -I$(realpath ../tmp/libogg/include)"
SOX_LDFLAGS="$SOX_LDFLAGS -L$(realpath ../tmp/libogg/lib)"
cd ..
mkdir tmp/libvorbis
cd libvorbis-1.3.5
CPPFLAGS="-I$(realpath ../tmp/libogg/include)" \
LDFLAGS="-L$(realpath ../tmp/libogg/lib)" \
./configure --enable-static --disable-shared --prefix=$(realpath ../tmp/libvorbis)
make && make install
SOX_CPPFLAGS="$SOX_CPPFLAGS -I$(realpath ../tmp/libvorbis/include)"
SOX_LDFLAGS="$SOX_LDFLAGS -L$(realpath ../tmp/libvorbis/lib)"
SOX_WITH="$SOX_WITH --with-oggvorbis"
cd ..
# echo "*** Warning: Doxygen not found; documentation will not be built."
# *** Warning: Doxygen not found; documentation will not be built.
# touch doxygen-build.stamp
#-----------------------
mkdir tmp/sox
cd sox-14.4.2
CPPFLAGS="$SOX_CPPFLAGS" \
LDFLAGS="$SOX_LDFLAGS" \
./configure --disable-shared --enable-static --prefix=$(realpath ../tmp/sox) \
$SOX_WITH \
--without-png --without-lpc10 --without-gsm \
--disable-symlinks
make clean
make -s && make install
cd ..
cp ./tmp/sox/bin/sox .
ls -l sox
# pi@raspberrypi:~/SOX $ ls -l sox
# -rwxr-xr-x 1 pi pi 3979940 Dec 13 14:08 sox
BUILD OPTIONS
Debugging build............no
Distro name ...............not specified!
Dynamic loading support....no
Pkg-config location........$(libdir)/pkgconfig
Play and rec symlinks......no
Symlinks enabled...........no
OPTIONAL DEVICE DRIVERS
ao (Xiph)..................no
alsa (Linux)...............no
coreaudio (Mac OS X).......no
sndio (OpenBSD)............no
oss........................yes
pulseaudio.................no
sunaudio...................no
waveaudio (MS-Windows).....no
OPTIONAL FILE FORMATS
amrnb......................no
amrwb......................no
flac.......................yes
gsm........................no
lpc10......................no
mp2/mp3....................yes
id3tag....................no
lame......................yes
lame id3tag...............yes
dlopen lame...............no
mad.......................yes
dlopen mad................no
twolame...................no
oggvorbis..................yes
opus.......................no
sndfile....................no
wavpack....................no
OTHER OPTIONS
ladspa effects.............no
magic support..............no
png support................no
OpenMP support.............yes, -fopenmp
Configure finished. Do 'make -s && make install' to compile and install SoX.
pi@raspberrypi:~/SOX/sox-14.4.2 $ ./configure --help
`configure' configures SoX 14.4.2 to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print `checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for `--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or `..']
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc. You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/sox]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
Program names:
--program-prefix=PREFIX prepend PREFIX to installed program names
--program-suffix=SUFFIX append SUFFIX to installed program names
--program-transform-name=PROGRAM run sed PROGRAM on installed program names
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
--target=TARGET configure for building compilers for TARGET [HOST]
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-silent-rules less verbose build output (undo: "make V=1")
--disable-silent-rules verbose build output (undo: "make V=0")
--enable-dependency-tracking
do not reject slow dependency extractors
--disable-dependency-tracking
speeds up one-time build
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
--enable-debug make a debug build
--disable-stack-protector
Disable GCC's/libc's stack-smashing protection
--disable-largefile omit support for large files
--disable-silent-libtool
Verbose libtool
--disable-openmp do not use OpenMP
--enable-dl-mad Dlopen mad instead of linking in.
--enable-dl-lame Dlopen lame instead of linking in.
--enable-dl-twolame Dlopen twolame instead of linking in.
--enable-dl-amrwb Dlopen amrbw instead of linking in.
--enable-dl-amrnb Dlopen amrnb instead of linking in.
--enable-dl-sndfile Dlopen sndfile instead of linking in.
--disable-symlinks Don't make any symlinks to sox.
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--without-libltdl Don't try to use libltdl for external dynamic
library support
--with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
both]
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-sysroot=DIR Search for dependent libraries within DIR
(or the compiler's sysroot if not specified).
--with-dyn-default Default to loading optional formats dynamically
--with-pkgconfigdir location to install .pc files or "no" to disable
(default=$(libdir)/pkgconfig)
--with-distro=distro Provide distribution name
--without-magic Don't try to use magic
--without-png Don't try to use png
--without-ladspa Don't try to use LADSPA
--with-ladspa-path Default search path for LADSPA plugins
--without-mad Don't try to use MAD (MP3 Audio Decoder)
--without-id3tag Don't try to use id3tag
--without-lame Don't try to use LAME (LAME Ain't an MP3 Encoder)
--without-twolame Don't try to use Twolame (MP2 Audio Encoder)
--with-oggvorbis=dyn load oggvorbis dynamically
--with-opus=dyn load opus dynamically
--with-flac=dyn load flac dynamically
--with-amrwb=dyn load amrwb dynamically
--with-amrnb=dyn load amrnb dynamically
--with-wavpack=dyn load wavpack dynamically
--with-sndio=dyn load sndio dynamically
--with-coreaudio=dyn load coreaudio dynamically
--with-alsa=dyn load alsa dynamically
--with-ao=dyn load ao dynamically
--with-pulseaudio=dyn load pulseaudio dynamically
--with-waveaudio=dyn load waveaudio dynamically
--with-sndfile=dyn load sndfile dynamically
--with-oss=dyn load oss dynamically
--with-sunaudio=dyn load sunaudio dynamically
--with-mp3=dyn load mp3 dynamically
--with-gsm=dyn load gsm dynamically
--with-lpc10=dyn load lpc10 dynamically
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
PKG_CONFIG path to pkg-config utility
PKG_CONFIG_PATH
directories to add to pkg-config's search path
PKG_CONFIG_LIBDIR
path overriding pkg-config's built-in search path
OPUS_CFLAGS C compiler flags for OPUS, overriding pkg-config
OPUS_LIBS linker flags for OPUS, overriding pkg-config
SNDFILE_CFLAGS
C compiler flags for SNDFILE, overriding pkg-config
SNDFILE_LIBS
linker flags for SNDFILE, overriding pkg-config
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to <sox-devel@lists.sourceforge.net>.
pi@raspberrypi:~/SOX $ ./sox
./sox: SoX v14.4.2
./sox FAIL sox: Not enough input filenames specified
Usage summary: [gopts] [[fopts] infile]... [fopts] outfile [effect [effopt]]...
SPECIAL FILENAMES (infile, outfile):
- Pipe/redirect input/output (stdin/stdout); may need -t
-d, --default-device Use the default audio device (where available)
-n, --null Use the `null' file handler; e.g. with synth effect
-p, --sox-pipe Alias for `-t sox -'
SPECIAL FILENAMES (infile only):
"|program [options] ..." Pipe input from external program (where supported)
http://server/file Use the given URL as input file (where supported)
GLOBAL OPTIONS (gopts) (can be specified at any point before the first effect):
--buffer BYTES Set the size of all processing buffers (default 8192)
--clobber Don't prompt to overwrite output file (default)
--combine concatenate Concatenate all input files (default for sox, rec)
--combine sequence Sequence all input files (default for play)
-D, --no-dither Don't dither automatically
--dft-min NUM Minimum size (log2) for DFT processing (default 10)
--effects-file FILENAME File containing effects and options
-G, --guard Use temporary files to guard against clipping
-h, --help Display version number and usage information
--help-effect NAME Show usage of effect NAME, or NAME=all for all
--help-format NAME Show info on format NAME, or NAME=all for all
--i, --info Behave as soxi(1)
--input-buffer BYTES Override the input buffer size (default: as --buffer)
--no-clobber Prompt to overwrite output file
-m, --combine mix Mix multiple input files (instead of concatenating)
--combine mix-power Mix to equal power (instead of concatenating)
-M, --combine merge Merge multiple input files (instead of concatenating)
--multi-threaded Enable parallel effects channels processing
--norm Guard (see --guard) & normalise
--play-rate-arg ARG Default `rate' argument for auto-resample with `play'
--plot gnuplot|octave Generate script to plot response of filter effect
-q, --no-show-progress Run in quiet mode; opposite of -S
--replay-gain track|album|off Default: off (sox, rec), track (play)
-R Use default random numbers (same on each run of SoX)
-S, --show-progress Display progress while processing audio data
--single-threaded Disable parallel effects channels processing
--temp DIRECTORY Specify the directory to use for temporary files
-T, --combine multiply Multiply samples of corresponding channels from all
input files (instead of concatenating)
--version Display version number of SoX and exit
-V[LEVEL] Increment or set verbosity level (default 2); levels:
1: failure messages
2: warnings
3: details of processing
4-6: increasing levels of debug messages
FORMAT OPTIONS (fopts):
Input file format options need only be supplied for files that are headerless.
Output files will have the same format as the input file where possible and not
overridden by any of various means including providing output format options.
-v|--volume FACTOR Input file volume adjustment factor (real number)
--ignore-length Ignore input file length given in header; read to EOF
-t|--type FILETYPE File type of audio
-e|--encoding ENCODING Set encoding (ENCODING may be one of signed-integer,
unsigned-integer, floating-point, mu-law, a-law,
ima-adpcm, ms-adpcm, gsm-full-rate)
-b|--bits BITS Encoded sample size in bits
-N|--reverse-nibbles Encoded nibble-order
-X|--reverse-bits Encoded bit-order
--endian little|big|swap Encoded byte-order; swap means opposite to default
-L/-B/-x Short options for the above
-c|--channels CHANNELS Number of channels of audio data; e.g. 2 = stereo
-r|--rate RATE Sample rate of audio
-C|--compression FACTOR Compression factor for output format
--add-comment TEXT Append output file comment
--comment TEXT Specify comment text for the output file
--comment-file FILENAME File containing comment text for the output file
--no-glob Don't `glob' wildcard match the following filename
AUDIO FILE FORMATS: 8svx aif aifc aiff aiffc al amb au avr cdda cdr cvs cvsd cvu dat dvms f32 f4 f64 f8 flac fssd gsrt hcom htk ima ircam la lu maud mp2 mp3 nist ogg prc raw s1 s16 s2 s24 s3 s32 s4 s8 sb sf sl sln smp snd sndr sndt sou sox sph sw txw u1 u16 u2 u24 u3 u32 u4 u8 ub ul uw vms voc vorbis vox wav wavpcm wve xa
PLAYLIST FORMATS: m3u pls
AUDIO DEVICE DRIVERS: oss ossdsp
EFFECTS: allpass band bandpass bandreject bass bend biquad chorus channels compand contrast dcshift deemph delay dither divide+ downsample earwax echo echos equalizer fade fir firfit+ flanger gain highpass hilbert input# loudness lowpass mcompand noiseprof noisered norm oops output# overdrive pad phaser pitch rate remix repeat reverb reverse riaa silence sinc speed splice stat stats stretch swap synth tempo treble tremolo trim upsample vad vol
* Deprecated effect + Experimental effect # LibSoX-only effect
EFFECT OPTIONS (effopts): effect dependent; see --help-effect
● sudo apt-get install soxでインストールした SoXには権利の関係で MP3機能が無い
sudo apt-get install soxでインストールした Sound eXchangeにはライセンスの関係で MP3機能が有りません。
sudo apt-get install sox
の場合は SoX v14.4.1
sudo apt-get install sox
pi@raspberrypi:~ $ sox
sox: SoX v14.4.1
Usage summary: [gopts] [[fopts] infile]... [fopts] outfile [effect [effopt]]...
SPECIAL FILENAMES (infile, outfile):
- Pipe/redirect input/output (stdin/stdout); may need -t
-d, --default-device Use the default audio device (where available)
-n, --null Use the `null' file handler; e.g. with synth effect
-p, --sox-pipe Alias for `-t sox -'
SPECIAL FILENAMES (infile only):
"|program [options] ..." Pipe input from external program (where supported)
http://server/file Use the given URL as input file (where supported)
GLOBAL OPTIONS (gopts) (can be specified at any point before the first effect):
--buffer BYTES Set the size of all processing buffers (default 8192)
--clobber Don't prompt to overwrite output file (default)
--combine concatenate Concatenate all input files (default for sox, rec)
--combine sequence Sequence all input files (default for play)
-D, --no-dither Don't dither automatically
--effects-file FILENAME File containing effects and options
-G, --guard Use temporary files to guard against clipping
-h, --help Display version number and usage information
--help-effect NAME Show usage of effect NAME, or NAME=all for all
--help-format NAME Show info on format NAME, or NAME=all for all
--i, --info Behave as soxi(1)
--input-buffer BYTES Override the input buffer size (default: as --buffer)
--no-clobber Prompt to overwrite output file
-m, --combine mix Mix multiple input files (instead of concatenating)
--combine mix-power Mix to equal power (instead of concatenating)
-M, --combine merge Merge multiple input files (instead of concatenating)
--magic Use `magic' file-type detection
--multi-threaded Enable parallel effects channels processing
--norm Guard (see --guard) & normalise
--play-rate-arg ARG Default `rate' argument for auto-resample with `play'
--plot gnuplot|octave Generate script to plot response of filter effect
-q, --no-show-progress Run in quiet mode; opposite of -S
--replay-gain track|album|off Default: off (sox, rec), track (play)
-R Use default random numbers (same on each run of SoX)
-S, --show-progress Display progress while processing audio data
--single-threaded Disable parallel effects channels processing
--temp DIRECTORY Specify the directory to use for temporary files
-T, --combine multiply Multiply samples of corresponding channels from all
input files (instead of concatenating)
--version Display version number of SoX and exit
-V[LEVEL] Increment or set verbosity level (default 2); levels:
1: failure messages
2: warnings
3: details of processing
4-6: increasing levels of debug messages
FORMAT OPTIONS (fopts):
Input file format options need only be supplied for files that are headerless.
Output files will have the same format as the input file where possible and not
overriden by any of various means including providing output format options.
-v|--volume FACTOR Input file volume adjustment factor (real number)
--ignore-length Ignore input file length given in header; read to EOF
-t|--type FILETYPE File type of audio
-e|--encoding ENCODING Set encoding (ENCODING may be one of signed-integer,
unsigned-integer, floating-point, mu-law, a-law,
ima-adpcm, ms-adpcm, gsm-full-rate)
-b|--bits BITS Encoded sample size in bits
-N|--reverse-nibbles Encoded nibble-order
-X|--reverse-bits Encoded bit-order
--endian little|big|swap Encoded byte-order; swap means opposite to default
-L/-B/-x Short options for the above
-c|--channels CHANNELS Number of channels of audio data; e.g. 2 = stereo
-r|--rate RATE Sample rate of audio
-C|--compression FACTOR Compression factor for output format
--add-comment TEXT Append output file comment
--comment TEXT Specify comment text for the output file
--comment-file FILENAME File containing comment text for the output file
--no-glob Don't `glob' wildcard match the following filename
AUDIO FILE FORMATS: 8svx aif aifc aiff aiffc al amb amr-nb amr-wb anb au avr awb caf cdda cdr cvs cvsd cvu dat dvms f32 f4 f64 f8 fap flac fssd gsm gsrt hcom htk ima ircam la lpc lpc10 lu mat mat4 mat5 maud nist ogg paf prc pvf raw s1 s16 s2 s24 s3 s32 s4 s8 sb sd2 sds sf sl sln smp snd sndfile sndr sndt sou sox sph sw txw u1 u16 u2 u24 u3 u32 u4 u8 ub ul uw vms voc vorbis vox w64 wav wavpcm wv wve xa xi
PLAYLIST FORMATS: m3u pls
AUDIO DEVICE DRIVERS: alsa
EFFECTS: allpass band bandpass bandreject bass bend biquad chorus channels compand contrast dcshift deemph delay dither divide+ downsample earwax echo echos equalizer fade fir firfit+ flanger gain highpass hilbert input# ladspa loudness lowpass mcompand mixer* noiseprof noisered norm oops output# overdrive pad phaser pitch rate remix repeat reverb reverse riaa silence sinc spectrogram speed splice stat stats stretch swap synth tempo treble tremolo trim upsample vad vol
* Deprecated effect + Experimental effect # LibSoX-only effect
EFFECT OPTIONS (effopts): effect dependent; see --help-effect
pi@raspberrypi:~ $ ls -l /usr/bin/sox
-rwxr-xr-x 1 root root 59324 Dec 30 2014 /usr/bin/sox
sudo apt-get install flac
pi@raspberrypi:~ $ flac -v
flac 1.3.2
pi@raspberrypi:~ $ flac
===============================================================================
flac - Command-line FLAC encoder/decoder version 1.3.2
Copyright (C) 2000-2009 Josh Coalson
Copyright (C) 2011-2016 Xiph.Org Foundation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
===============================================================================
This is the short help; for all options use 'flac --help'; for even more
instructions use 'flac --explain'
Be sure to read the list of known bugs at:
http://xiph.org/flac/documentation_bugs.html
To encode:
flac [-#] [INPUTFILE [...]]
-# is -0 (fastest compression) to -8 (highest compression); -5 is the default
To decode:
flac -d [INPUTFILE [...]]
To test:
flac -t [INPUTFILE [...]]
sudo apt-get install mpg123
pi@raspberrypi:~ $ mpg123 --version
mpg123 1.23.8
pi@raspberrypi:~ $ mpg123 -?
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.23.8; written and copyright by Michael Hipp and others
free software (LGPL) without any warranty but with best wishes
usage: mpg123 [option(s)] [file(s) | URL(s) | -]
supported options [defaults in brackets]:
-v increase verbosity level -q quiet (don't print title)
-t testmode (no output) -s write to stdout
-w f write output as WAV file
-k n skip first n frames [0] -n n decode only n frames [all]
-c check range violations -y DISABLE resync on errors
-b n output buffer: n Kbytes [0] -f n change scalefactor [32768]
-r n set/force samplerate [auto]
-o m select output module -a d set audio device
-2 downsample 1:2 (22 kHz) -4 downsample 1:4 (11 kHz)
-d n play every n'th frame only -h n play every frame n times
-0 decode channel 0 (left) only -1 decode channel 1 (right) only
-m mix both channels (mono) -p p use HTTP proxy p [$HTTP_PROXY]
-@ f read filenames/URLs from f -T get realtime priority
-z shuffle play (with wildcards) -Z random play
-u a HTTP authentication string -E f Equalizer, data from file
-C enable control keys --no-gapless not skip junk/padding in mp3s
-? this help --version print name + version
See the manpage mpg123(1) or call mpg123 with --longhelp for more parameters and information.
Tags: [Raspberry Pi], [電子工作]
●関連するコンテンツ(この記事を読んだ人は、次の記事も読んでいます)
FWinSdCardImager SDカード イメージ書き込みアプリ、ラズパイの Raspbian OS、Jetson Nanoの Ubuntuの書き込みに便利
ラズパイや Jetson Nano等のワンボードマイコン等への OSイメージの書き込みが簡単にできる
FWinPiFinder ラズベリーパイ IPアドレス発見アプリ。ARPコマンドでラズパイの IPアドレスを探索発見する
Raspberry Piや NVIDIA Jetson Nano等の IPアドレスを MACアドレスの OUI部分を使用して発見する
Raspberry Pi 3系のトラブルであるある第一位の電源トラブル、低電圧警報に関する情報のまとめ
ラズパイ3B系での低電圧警報に関する情報まとめ、コマンドラインやログファイルから低電圧を検知する方法
Raspberry Piで CPUの脆弱性 Spectreと Meltdownの脆弱性をチェックする方法
ラズパイで 2018年初頭に大騒ぎになったスペクターとメルトダウンの CPUの脆弱性をチェックする方法
Raspberry Pi Zero Wを海外通販の Pimoroni等での購入方法、購入できる通販ショップ一覧まとめ
ラズパイゼロW ワイヤレスモデルを海外通販でサクッと簡単に個人輸入で入手。技適通過でも国内販売は常に品切れ
Raspberry Pi 3で安定して使える相性の無い最適な microSDカードの種類のまとめ
ラズパイ3で安定して使える microSDカードを購入する Teamと SanDiskは絶対に買わない
Raspberry Pi 3 Model Bに専用カメラモジュール RaspiCamを接続する方法
ラズパイに専用カメラモジュールを接続して Raspbianで写真の静止画撮影や動画を録画する方法
Raspberry Pi 3の Linuxコンソール上で使用する各種コマンドまとめ
ラズパイの Raspbian OSのコマンドラインで使用する便利コマンド、負荷試験や CPUシリアル番号の確認方法等も
Raspberry Pi 3公式フォーラムの FAQの内容の日本語訳
ラズパイ公式フォーラムの「The Raspberry Pi 3 Model B Q&A thread」の日本語訳
Raspberry Pi 3で GPIO端子の I2C機能を有効化する方法
ラズパイ3の GPIO端子の I2C機能を有効にして各種センサーを繋げる方法まとめ
大人気の CPUボード、Raspberry Pi 3 Model Bで作ってみよう
Raspberry Piの開発環境の構築やタッチパネル付き液晶ディスプレイや各種センサーの使い方まとめ
Raspberry Pi関連はこちらへまとめました
下記以外にも多数のラズパイ関係の記事が有ります。
(I2C制御、GPIO制御、1-Wire制御、シリアル通信、日本語音声合成、日本語音声認識、中国語音声合成、MeCab 形態素解析エンジン、赤外線リモコン制御、秋月 I2C液晶モジュール、KeDei 3.5インチ液晶、HDMI 5インチ液晶、NFCカードリーダ、コマンドライン操作方法等)
Espressif ESP8266 Arduino互換でスケッチが使える ESP-12Eモジュール基板
Espressif ESP8266 ESP-12-E NodeMCU V1 ESP12 CP2102
BangGood通販はドローン以外にも面白い商品がまだまだ有った(電子工作編)
レーザー彫刻機、カラー液晶の DIYオシロ、Arduinoや Raspberry Pi用の小型カラー液晶
[HOME]
|
[BACK]
リンクフリー(連絡不要、ただしトップページ以外は Web構成の変更で移動する場合があります)
Copyright (c)
2017 FREE WING,Y.Sakamoto
Powered by 猫屋敷工房 & HTML Generator
http://www.neko.ne.jp/~freewing/raspberry_pi/raspberry_pi_3_build_sox_sound_exchange/