CatchSound()

Syntax

Result = CatchSound(#Sound, MemoryAddress [, Length [, Flags]])
Description
Load a WAV or any other format supported by the SoundPlugin library contained at the specified address. If #PB_Any is used as '#Sound' parameter, the new sound number will be returned as 'Result'. If the 'Result' is not 0, the sound has been correctly loaded and is ready to be played with the function PlaySound(), else the sound loading has failed. With WAV files, the 'Length' parameter doesn't need to be specified. The following functions can be used to enable automatically more sound formats:

UseFLACSoundDecoder(): 'Length' parameter must be specified
UseOGGSoundDecoder(): 'Length' parameter must be specified

The 'Flags' optional parameter can be a combination of the following values:
  #PB_Sound_Streaming: Enable streaming playback (only supported for FLAC and OGG))
Example:
  CatchSound(0, ?Music)
  End

  DataSection
    Music: IncludeBinary "Sound.wav"
Note: The "?" is a pointer to a label. More informations about pointers and memory access can be found in the relating chapter here.

Supported OS

All

Sound Index - FreeSound() ->