Meteor2D  dev internal
Meteor is a lightweight 2D game engine.
Loading...
Searching...
No Matches
meteor::MAudioPlayable Class Reference

This class is the Playable instance of AudioClip. Provides various playback functions. More...

#include <audioplayable.h>

Inheritance diagram for meteor::MAudioPlayable:

Public Member Functions

long getLength ()
 Get length of the clip in milliseconds.
 
void prepare ()
 Prepares the instance for playback, needed before playaback can be done.
 
void play ()
 Plays the audio clip.
 
void pause ()
 Pauses audio playback.
 
void reset ()
 Resets current position in playback to the begining of the clip.
 
bool isLooped ()
 
void setIsLooped (bool loop)
 Set loop status of the playback.
 
float getVolume ()
 
void setVolume (float volume)
 Set volume level of the playback.
 
bool isPaused ()
 
float getPlaybackSpeed ()
 
void setPlaybackSpeed (float val)
 Set playback speed.
 

Friends

class MAudioClip
 

Detailed Description

This class is the Playable instance of AudioClip. Provides various playback functions.

Member Function Documentation

◆ getLength()

long meteor::MAudioPlayable::getLength ( )

Get length of the clip in milliseconds.

Returns
long representing the length of the clip.

◆ getPlaybackSpeed()

float meteor::MAudioPlayable::getPlaybackSpeed ( )
Returns
speed of playback.

◆ getVolume()

float meteor::MAudioPlayable::getVolume ( )
Returns
Volume of playback between 0 and 1

◆ isLooped()

bool meteor::MAudioPlayable::isLooped ( )
Returns
true if playback is looped.

◆ isPaused()

bool meteor::MAudioPlayable::isPaused ( )
Returns
true if playaback is paused.

◆ setIsLooped()

void meteor::MAudioPlayable::setIsLooped ( bool loop)

Set loop status of the playback.

Parameters
loopbool representating new loop status of playback.

◆ setPlaybackSpeed()

void meteor::MAudioPlayable::setPlaybackSpeed ( float val)

Set playback speed.

Parameters
valnew playback speed.

◆ setVolume()

void meteor::MAudioPlayable::setVolume ( float volume)

Set volume level of the playback.

Parameters
volumefloat between 0 and 1, representating new volume level.