an open-source digital signal processing and sound synthesis language
about · links · contact
sfcreate - create soundfile header, or change existing one


sfcreate [ -r sampling_rate ] [ -c num_channels ] [ -t header_format ] [ -i | -f ] [ -b | -l ] [ --force ] file_name


If file_name doesn't exist, sfcreate creates a new file with the specified soundfile header. If file_name already exists, sfcreate puts a soundfile header at the beginning of the file, overwriting whatever was there. (See WARNINGS below.) Without a file_name argument, sfcreate just prints a help summary.

This command is mainly useful for disk-based Cmix scripts, in which the output function expects to find a file with a soundfile header. You can run sfcreate from within such a script by using the system function.


Use big-endian sample data format. This is the default for all file types except wav. (Use either this or -l.)

-c num_channels
Use num_channels number of channels. The default is 2.

Use floating-point sample data format. (Use either this or -i.)

Use 16-bit (short) integer sample data format. This is the default. (Use either this or -f.)

Use little-endian sample data format. This is the default for -t wav. (Use either this or -b.)

-r sampling_rate
Use the sampling rate given by sampling_rate. 44100 is the default.

-t header_format
Use the specified file format. The possibilities are:
AIFF format

AIFC format

Microsoft RIFF (Wav) format

NeXT format (same as sun)

Sun "au'' format (same as next)

IRCAM format

aiff (or aifc for floats) is the default.

Overwrite the header of an existing file, even if this might result in swapped channels or corrupted sample words. You will be told if these things have happened after they've happened. (Isn't that nice!)


See Also

sfprint, sfhedit, sffixsize


John Gibson <johgibso at indiana edu>, based on the original Cmix sfcreate, but revised to work with multiple soundfile header types. Thanks to Bill Schottstaedt, whose sndlib sound file library makes this possible.