|
HephAudio v3.1.0
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
|
stores information that's necessary to play audio. More...
#include <AudioObject.h>
Public Member Functions | |
| AudioObject () | |
| AudioObject (AudioObject &&rhs) noexcept | |
| AudioObject & | operator= (AudioObject &&rhs) noexcept |
| double | GetPosition () const |
| void | SetPosition (double position) |
| void | Pause () |
| void | Resume () |
Static Public Member Functions | |
| static void | DefaultRenderHandler (const Heph::EventParams &eventParams) |
| static void | MatchFormatRenderHandler (const Heph::EventParams &eventParams) |
| static void | DefaultFinishedPlayingHandler (const Heph::EventParams &eventParams) |
Public Attributes | |
| Heph::Guid | id |
| std::filesystem::path | filePath |
| std::string | name |
| bool | isPaused |
| uint32_t | playCount |
| double | volume |
| AudioBuffer | buffer |
| size_t | frameIndex |
| Heph::Event | OnRender |
| Heph::Event | OnFinishedPlaying |
stores information that's necessary to play audio.
| HephAudio::AudioObject::AudioObject | ( | ) |
creates a new instance and initializes it with default values.
|
noexcept |
creates a new instance and moves the rhs's data to it.
| rhs | instance whose data will be moved. |
| double HephAudio::AudioObject::GetPosition | ( | ) | const |
calculates the playback position between 0 and 1.
| void HephAudio::AudioObject::SetPosition | ( | double | position | ) |
sets the playback position.
| position | between 0 and 1. |
| void HephAudio::AudioObject::Pause | ( | ) |
stops playing the audio object.
| void HephAudio::AudioObject::Resume | ( | ) |
starts playing the audio object.
|
static |
the default handler for the AudioObject::OnRender event. Plays the audio data as is.
|
static |
an handler for the AudioObject::OnRender event. Converts the audio data to the render format before playing.
|
static |
the default handler for the AudioObject::OnFinishedPlaying event. If looping, replays the audio object; otherwise, destroys it.
| Heph::Guid HephAudio::AudioObject::id |
unique identifier of the object.
| std::filesystem::path HephAudio::AudioObject::filePath |
path of the file the object is created with, or empty if created via NativeAudio::CreateAudioObject.
| std::string HephAudio::AudioObject::name |
name of the object.
| bool HephAudio::AudioObject::isPaused |
indicates whether the object is paused. If true, the object will not be played until this field is set to false.
| uint32_t HephAudio::AudioObject::playCount |
number of times the object will be played. Set this to HEPHAUDIO_INFINITE_LOOP in order to play it infinite times.
| double HephAudio::AudioObject::volume |
loudness of the audio between 0 and 1.
| AudioBuffer HephAudio::AudioObject::buffer |
contains the audio data.
| size_t HephAudio::AudioObject::frameIndex |
index of the first audio frame that will be rendered (played) next.
| Heph::Event HephAudio::AudioObject::OnRender |
event that will be invoked each time before rendering (playing) audio data.
| Heph::Event HephAudio::AudioObject::OnFinishedPlaying |
event that will be invoked each time when the object finishes playing.