API Sound.Create

From Flowcode Help
Jump to navigationJump to search
Fc9-comp-macro.png Create
Creates a sound object that data can be played through 
Fc9-u32-icon.png - ULONG SampleRate
The number of samples per second 
Fc9-u8-icon.png - BYTE SampleBits
The number of bits per sample - either 8 or 16 
Fc9-bool-icon.png - BOOL Stereo
True to treat each pair of samples as a stereo sample 
Fc9-h32-icon.png - HANDLE Return


Detailed description

Sounds can only be played directly through the Sound.Play call or through a handle to a sound channel. Sounds played through a handle can be queued and played in sequence, allowing multiple sounds to be played seamlessly.


Sounds can be queued on an event, Sound.Complete, which is a notification that any sound played through this mechanism has finished.


The parameters used here will define the basics of the sound and are used to define the underlying system. Any sounds played have their values adjusted by Flowcode to conform to these values - a sound played which has a native sample rate and details matching the parameters of this call will in general be more efficient and clearer than a sound where the sample rate has to be adjusted to fit.


Examples

Calling in a calculation

  • Declare a variable 'result' of type HANDLE
  • Add to a calculation icon:
    result = ::Sound.Create(samplerate, samplebits, false)