sndinfo

sndinfo — Displays information about a soundfile.

Description

Get basic information about one or more soundfiles.

Syntax

csound -U sndinfo [options] soundfilenames ...
sndinfo [options] soundfilenames ...

Initialization

sndinfo will attempt to find each named file, open it for reading, read in the soundfile header, then print a report on the basic information it finds. The order of search across soundfile directories is as described furthermore. If the file is of type AIFF, some further details are listed first.

There are two option types:

  1. -i or -i1 will print instrument information, which includes looping. The option continues until a -i0 option.

  2. The other option is -b which prints the broadcast information for WAV files. It can similarly be negated with -b0.

Directories

Filenames are of two kinds, source soundfiles and resultant analysis files. Each has a hierarchical naming convention, influenced by the directory from which the Utility is invoked. Source soundfiles with a full pathname (begins with dot (.), slash (/), or for ThinkC includes a colon (:)), will be sought only in the directory named. Soundfiles without a path will be sought first in the current directory, then in the directory named by the SSDIR environment variable (if defined), then in the directory named by SFDIR. An unsuccessful search will return a "cannot open" error.

Resultant analysis files are written into the current directory, or to the named directory if a path is included. It is tidy to keep analysis files separate from sound files, usually in a separate directory known to the SADIR variable. Analysis is conveniently run from within the SADIR directory. When an analysis file is later invoked by a Csound generator it is sought first in the current directory, then in the directory defined by SADIR.

Examples

csound -U sndinfo test Bosendorfer/"BOSEN mf A0 st" foo foo2

where the environment variables SFDIR = /u/bv/sound, and SSDIR = /so/bv/Samples, might produce the following:

util  SNDINFO:      
     /u/bv/sound/test:
           srate 22050, monaural, 16 bit shorts, 1.10 seconds
           headersiz 1024, datasiz 48500  (24250 sample frames)
  
    /so/bv/Samples/Bosendorfer/BOSEN mf A0 st:  AIFF, 197586 stereo samples, base Frq 261.6 (MIDI 60), sustnLp: mode 1, 121642 to 197454, relesLp: mode 0
     AIFF soundfile, looping with modes 1, 0
     srate 44100, stereo, 16 bit shorts, 4.48 seconds
  
     headersiz  402, datasiz 790344  (197586 sample frames)
  
     /u/bv/sound/foo:
           no recognizable soundfile header
  
     /u/bv/sound/foo2:
            couldn't find