Linux Commands Examples

A great documentation place for Linux commands

soxi

Sound eXchange Information, display sound file metadata


see also : display - sox

Synopsis

soxi [-V[level]] [-T] [-t|-r|-c|-s|-d|-D|-b|-B|-e|-a] infile1 ...


add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!

examples

0
source
            
if test "$(soxi -r $file)" != 22050; then break; fi
error=channels
if test "$(soxi -c $file)" != 1; then break; fi
if test "$(soxi -b $file)" != 16; then break; fi
error=encoding
if test "$(soxi -e $file)" != "Signed Integer PCM"; then break; fi
0
source
            
InfoFormat=$(soxi -e "$i")
InfoDepth=$(soxi -b "$i")
InfoFreq=$(soxi -r "$i")
if [ ${filedir:0:1} == "/" ]; then
0
source
            
len=`soxi -D $fn`
query="UPDATE tracks SET length=$len WHERE track_title=\"$fn\""
# echo $fn
0
source
            
echo "wav length:"
soxi -D $f
;;
esac
echo "\n"
done
0
source
            
echo "$@ "`soxi -c "$@"`
0
source
            
*)
c=`soxi -c "$a"`
r=`soxi -r "$a"`
k=0
channels=
while [ $k -lt $c ]; do
k=$(($k+1))
0
source
            
artist=$(soxi $1 | grep --color=never "Artist=" | sed s/Artist=//)
track=$(soxi $1 | grep --color=never "Title=" | sed s/Title=//)
year=$(soxi $1 | grep --color=never "Year=" | sed s/Year=//)
bpm=$(sox $1 -t raw -r 44100 -e float -c 1 - 2> /dev/null | bpm)

description

Displays information from the header of a given audio file or files. Supported audio file types are listed and described in soxformat(7). Note however, that soxi is intended for use only with audio files with a self-describing header.

By default, as much information as is available is shown. An option may be given to select just a single piece of information (perhaps for use in a script or batch-file).

options

-V

Set verbosity. See sox(1) for details.

-T

Used with multiple files; changes the behaviour of -s, -d and -D to display the total across all given files. Note that when used with -s with files with different sampling rates, this is of questionable value.

-t

Show detected file-type.

-r

Show sample-rate.

-c

Show number of channels.

-s

Show number of samples (0 if unavailable).

-d

Show duration in hours, minutes and seconds (0 if unavailable). Equivalent to number of samples divided by the sample-rate.

-D

Show duration in seconds (0 if unavailable).

-b

Show number of bits per sample.

-B

Show the bitrate averaged over the whole file (0 if unavailable).

-e

Show the name of the audio encoding.

-a

Show file comments (annotations) if available.

license

Copyright 2008-2013 by Chris Bagwell and SoX Contributors.

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, 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.


bugs

Please report any bugs found in this version of SoX to the mailing list (sox-users[:at:]lists.sourceforge[:dot:]net).


see also

sox , soxformat, libsox

The SoX web site at http://sox.sourceforge.net


authors

Chris Bagwell (cbagwell[:at:]users.sourceforge[:dot:]net). Other authors and contributors are listed in the ChangeLog file that is distributed with the source code.

How can this site be more helpful to YOU ?


give  feedback