roccodrom

SoX

SoX - Sound eXchange is a cross platform command line tool for converting and editing audio files.

Installation

SoX is available in the termux repositories. To install it, just type pkg install sox and press enter.

Configuration

To enable recording from the microphone or standard input add following line in $PREFIX/etc/pulse/default.pa

load-module module-sles-source

Usage

Conversion

sox input.wav output.mp3

Playback

play audio.wav

Recording

rec audio.wav trim 0 00:10

More examples

Normalize an audio file (adjust volume to the maximum peak level, without clipping):

sox --norm input\_audiofile output\_audiofile

Alternative:

sox input\_audiofile output\_audiofile norm

The standard bitrate for conversion to mp3 is 64 kbit per channel.

SoX tricks

backlinks: blog uses audio