Skip to main content
Version: 1.0.0-preview.38

Velaptor.Content.IAudio

Velaptor

Velaptor.Content

IAudio Interface

A single audio that can be played, paused etc.

public interface IAudio :
Velaptor.Content.IContent,
System.IDisposable

Derived
Audio

Implements IContent, System.IDisposable

Properties

BufferType

Gets the type of buffer.

Velaptor.Content.AudioBuffer BufferType { get; }

Property Value

AudioBuffer

FilePath

Gets the fully qualified path to the content file.

string FilePath { get; }

Implements FilePath

Property Value

System.String

Id

Gets the unique ID of the audio.

uint Id { get; }

Property Value

System.UInt32

IsLooping

Gets or sets a value indicating whether the audio loops back to the beginning once the end has been reached.

bool IsLooping { get; set; }

Property Value

System.Boolean

IsPaused

Gets a value indicating whether the audio is paused.

bool IsPaused { get; }

Property Value

System.Boolean

IsPlaying

Gets a value indicating whether the audio is playing.

bool IsPlaying { get; }

Property Value

System.Boolean

IsStopped

Gets a value indicating whether the audio is stopped.

bool IsStopped { get; }

Property Value

System.Boolean

Length

Gets the length of the song.

System.TimeSpan Length { get; }

Property Value

System.TimeSpan

Name

Gets the name of the content.

string Name { get; }

Implements Name

Property Value

System.String

PlaySpeed

Gets or sets the play speed to the given value.

float PlaySpeed { get; set; }

Property Value

System.Single

Remarks

The valid range of value is between 0.25 and 2.0
with a value less then 0.25 defaulting to 0.25 and
with a value greater then 2.0 defaulting to 2.0.

Position

Gets the current time position of the audio.

System.TimeSpan Position { get; }

Property Value

System.TimeSpan

Volume

Gets or sets the volume of the audio.

float Volume { get; set; }

Property Value

System.Single

Remarks

The only valid value accepted is 0-100. If a value outside of
this range is used, it will be set within that range.

Methods

FastForward(float)

Fast forwards the audio by the given amount of seconds.

void FastForward(float seconds);

Parameters

seconds System.Single

The amount of seconds to fast-forward the song.

Pause()

Pauses the audio.

void Pause();

Play()

Plays the audio.

void Play();

Rewind(float)

Rewinds the audio by the given amount of seconds.

void Rewind(float seconds);

Parameters

seconds System.Single

The amount of seconds to rewind the song.

SetTimePosition(float)

Sets the time position of the audio to the given value.

void SetTimePosition(float seconds);

Parameters

seconds System.Single

The time position in seconds of where to set the audio.

Stop()

Stops the audio playback and resets back to the beginning.

void Stop();