A newer version of Max is available. Click here to access the latest version of this document.

sfinfo~

Report audio file information

Description

sfinfo~ gives you the number of channels, sample size, sampling rate, sampletype, filename, and duration of a soundfile.

Arguments

Name Type Opt Description
filename symbol opt Names a file that sfinfo~ will report about when it receives a subsequent bang message. The file must exist in the Max search path.

Messages

bang If a file has already been opened, either with the open message or specified by an argument to sfinfo~, bang reports the number of channels, sample size, sample rate, and length in milliseconds out the sfinfo~ object's outlets.
getnamed object-name [symbol]
In left inlet: The word getnamed, followed by a symbol which specifies the name of an sfplay~ object, interrogates the named sfplay~ object and reports the number of channels, sample size, sample rate, file length in milliseconds, sample type, and filename out its outlets.
open filename [symbol]
The word open, followed by a name of an audio file, opens the file if it exists in Max's search path. Without a filename, open brings up a standard open file dialog allowing you to choose a file. After the file is opened, sfinfo~ interrogates the file and reports the number of channels, sample size, sample rate, file length in milliseconds, sample type, and filename out its outlets.

Information for box attributes common to all objects

Output

alaw: 8-bit a-law encoding

Out 6th outlet: The filename of the audio file
float: Out 3rd outlet: The audio file's sampling rate.

Out 4th outlet: The duration of the audio file in milliseconds.
float32: 32-bit floating-point
float64: 64-bit floating-point
int: Out left outlet: The number of channels in the audio file.

Out 2nd outlet: The audio file's sample size in bits (typically 16).
int16: 16-bit integer
int24: 24-bit integer
int32: 32-bit integer
int8: 8-bit integer
mulaw: 8-bit "mu"-law encoding
symbol: Out 5th outlet: the sample type of the audio file.

The following types of sample data are supported:

Examples

Report information about a specific audio file

See Also

Name Description
info~ Report information about a sample
sflist~ Store audio file cues
sfplay~ Play audio file from disk
MSP Tutorial 16: Record and Play Audio Files MSP Tutorial 16: Record and Play Audio Files