CatchSound()

Syntax

Result = CatchSound(#Sound, *Buffer [, Size [, Flags]])
Description
Load a WAV (in PCM format, ADPCM is not supported) or any other format supported by the SoundPlugin library found at the specified address. The following functions can be used to enable automatically more sound formats:

UseFLACSoundDecoder()
UseOGGSoundDecoder()

Parameters

#Sound A number to identify the new sound. #PB_Any can be used to auto-generate this number.
*Buffer The buffer to use to create the sound. This is a regular memory address.
Size (optional) The buffer size (in bytes). With WAV files, this parameter doesn't need to be specified. With other sound decoders, it has to be specified.
Flags (optional) It can be the following value:
  #PB_Sound_Streaming: Enable streaming playback (only supported for FLAC and OGG))

Return value

Nonzero if the sound has been successfully created, zero otherwise.

Example

  CatchSound(0, ?Music)
  End

  DataSection
    Music: 
      IncludeBinary "Sound.wav"

Remarks

The "?" is a pointer to a label. More information about pointers and memory access can be found in the relating chapter here.

See Also

LoadSound(), FreeSound(), PlaySound()

Supported OS

All

Sound Index - FreeSound() ->