:GetFormat() - Determines the File Format of the Audio File.


Class

     aprAudio()

 

Syntax

     :GetFormat(cInFile[, N_C]) --> cnResults

 

Parameters

 

 

cInFile

File Name of an Audio File

 

N_C

Character "N" for Numeric Results or "C" for String Results, Default is "C"

 

Return

     cnResults depends on the Parameter N_C.

     If "N" is passed, the retun value is Numeric

     If "C" is passed or the Parameter is not entered, the return value is a String indicating the File Format.

 

Description

Determines the File Format of the Audio File.

 

 

Format

Description

AUDIO_FORMAT_AIFF

Silicon Graphics and Apple sound format

AUDIO_FORMAT_SUN

Sun and NeXT sound format

AUDIO_FORMAT_VOICE

Create Labs sound format

AUDIO_FORMAT_WAVE

Microsoft Windows sound format

AUDIO_FORMAT_MIDI

MIDI sound format

AUDIO_FORMAT_RAW

Raw 8-bit sound format

 

 

If the function fails, the return value is AUDIO_FORMAT_NONE, meaning that the audio format could be determined.

 

The function first attempts to determine the format based on the file extension. If this is unsuccessful, it will then open the file and examine the header block of the audio data and attempt to determine the format based on it's contents. If a recognized extension is specified on a file with a different format (for example, a WAV audio file with an .AU extension) this function will not return the correct format identifier.

 

Note that although :GetFormat() will identify MIDI audio files, Methods such as :Convert() and :Play() will not recognize the MIDI audio format. The Windows multimedia API should be used to play MIDI audio files.

 

See Also

:Convert(), :Play()