Plays audio.
    public class AudioStreamSample : AudioStream

Plays audio, can loop.

Inheritance Chain

Constructors

    public AudioStreamSample()

Properties

    public byte[] Data { get; set; }

Contains the audio data in bytes.

    public FormatEnum Format { get; set; }

Audio format. See FORMAT_* constants for values.

    public int LoopBegin { get; set; }

Loop start in bytes.

    public int LoopEnd { get; set; }

Loop end in bytes.

    public LoopModeEnum LoopMode { get; set; }

Loop mode. See LOOP_* constants for values.

    public int MixRate { get; set; }

The sample rate for mixing this audio.

    public bool Stereo { get; set; }

If true, audio is stereo. Default value: false.

Methods

    public byte[] GetData()

Getter for Data

    public FormatEnum GetFormat()

Getter for Format

    public int GetLoopBegin()

Getter for LoopBegin

    public int GetLoopEnd()

Getter for LoopEnd

    public LoopModeEnum GetLoopMode()

Getter for LoopMode

    public int GetMixRate()

Getter for MixRate

    public bool IsStereo()

Getter for Stereo

    public Error SaveToWav(string path)

Saves the AudioStreamSample as a WAV file to path. Samples with IMA ADPCM format can’t be saved.

Note that a .wav extension is automatically appended to path if it is missing.

    public void SetData(byte[] data)

Setter for Data

    public void SetFormat(FormatEnum format)

Setter for Format

    public void SetLoopBegin(int loopBegin)

Setter for LoopBegin

    public void SetLoopEnd(int loopEnd)

Setter for LoopEnd

    public void SetLoopMode(LoopModeEnum loopMode)

Setter for LoopMode

    public void SetMixRate(int mixRate)

Setter for MixRate

    public void SetStereo(bool stereo)

Setter for Stereo

Inner Types

FormatEnum

Name Value Description
Format8Bits    
Format16Bits    
ImaAdpcm 2 Audio codec IMA ADPCM.

LoopModeEnum

Name Value Description
Disabled 0 Audio does not loop.
Forward 1 Audio loops the data between loop_begin and loop_end playing forward only.
PingPong 2 Audio loops the data between loop_begin and loop_end playing back and forth.
Backward 3 Audio loops the data between loop_begin and loop_end playing backward only.
Tags: