Ctrl+K

SoundBuffer

Declaration

public abstract class Strawberry.Sound.SoundBuffer

A sound buffer that can be used to play a sound

Inherits: Strawberry.DisposableReferenceObject

Properties

SoundManager abstract

Gets the SoundManager using which the buffer is created.

ISoundManager SoundManager { get }

BitsPerSample abstract

Gets bits per sample of the audio

int BitsPerSample { get }

SampleRate abstract

Gets the sample rate of the audio

int SampleRate { get }

Channels abstract

Gets the number of channels in the audio. 1 for mono, 2 for stereo

int Channels { get }

Seconds abstract

Gets the time in seconds of the audio

float Seconds { get }

Methods

Play abstract

Plays the buffer

Voice Play(bool loop = false)

Parameters:

Name Type Description
loop System.Boolean = false Whether to loop the buffer

Returns: The corresponding voice which will be played. You can use this object to stop the playing sound

Play abstract

Plays the buffer using a frequency ratio

Voice Play(float frequencyRatio, bool loop = false)

Parameters:

Name Type Description
frequencyRatio System.Single The frequency ratio
loop System.Boolean = false Whether to loop the buffer

Returns: The corresponding voice which will be played. You can use this object to stop the playing sound

Play abstract

Plays the buffer on the specified position

Voice3D Play(Vector2 position, bool loop = false)

Parameters:

Name Type Description
position Strawberry.Math.Vector2 The position of the played voice
loop System.Boolean = false Whether to loop the buffer

Returns: The corresponding voice which will be played. You can use this object to stop the playing sound

Play abstract

Plays the buffer using a frequency ratio on the specified position

Voice3D Play(Vector2 position, float frequencyRatio, bool loop = false)

Parameters:

Name Type Description
position Strawberry.Math.Vector2 The position of the played voice
frequencyRatio System.Single The frequency ratio
loop System.Boolean = false Whether to loop the buffer

Returns: The corresponding voice which will be played. You can use this object to stop the playing sound

Play abstract

Plays the buffer using the specified settings

Voice3D Play(Voice3DSettings settings, bool loop = false)

Parameters:

Name Type Description
settings Strawberry.Sound.Voice3DSettings
loop System.Boolean = false Whether to loop the buffer

Returns: The corresponding voice which will be played. You can use this object to stop the playing sound

Play abstract

Plays the buffer using a frequency ratio using the specified settings

Voice3D Play(Voice3DSettings settings, float frequencyRatio, bool loop = false)

Parameters:

Name Type Description
settings Strawberry.Sound.Voice3DSettings The settings to be used by the voice
frequencyRatio System.Single The frequency ratio
loop System.Boolean = false Whether to loop the buffer

Returns: The corresponding voice which will be played. You can use this object to stop the playing sound

Stop abstract

Stops all the voices played using this buffer.

void Stop()

IsPlaying abstract

Checks whether or not a voice is being played using this buffer.

bool IsPlaying()

Returns: True if a voice is beign played