Meteor2D  dev internal
Meteor is a lightweight 2D game engine.
Loading...
Searching...
No Matches
audiosource.h
1#pragma once
2#include <audio/audioplayable.h>
3#include <entities/spatial.h>
4
5namespace meteor {
9 class MAudioSource : public MSpatialEntity {
10 public:
17 MAudioSource(std::string clipPath, bool loop,bool autoStart);
18 void onExit() override;
22 void play();
26 bool isPaused();
30 void pause();
34 void stop();
38 bool isLooped();
43 void setIsLooped(bool loop);
47 float getVolume();
52 void setVolume(float volume);
61 void setPlaybackSpeed(float playbackSpeed);
62 private:
63 MAudioPlayable* playable = NULL;
64 };
65}
This class is the Playable instance of AudioClip. Provides various playback functions.
Definition audioplayable.h:14
This class represents an audio source in the game world.
Definition audiosource.h:9
void setVolume(float volume)
Set volume level of playback.
MAudioSource(std::string clipPath, bool loop, bool autoStart)
Construnctor.
void stop()
Pause playback and reset to the begining.
void play()
Plays audio clip.
void setIsLooped(bool loop)
Set playback loop status.
void setPlaybackSpeed(float playbackSpeed)
Set playback speed.
void pause()
Pause playback.
Spatial Entity is the base entity for all types present in scene. This entity keeps track of spatial ...
Definition spatial.h:15