HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
Loading...
Searching...
No Matches
AudioObject.h
Go to the documentation of this file.
1#pragma once
2#include "HephAudioShared.h"
3#include "AudioBuffer.h"
4#include "Event.h"
5#include "Guid.h"
6#include <vector>
7#include <filesystem>
8
15#define HEPHAUDIO_INFINITE_LOOP (0)
16
21#define HEPHAUDIO_RENDER_HANDLER_DEFAULT &HephAudio::AudioObject::DefaultRenderHandler
22
27#define HEPHAUDIO_RENDER_HANDLER_MATCH_FORMAT &HephAudio::AudioObject::MatchFormatRenderHandler
28
29namespace HephAudio
30{
36 {
42
47 std::filesystem::path filePath;
48
53 std::string name;
54
61
67 uint32_t playCount;
68
74 double volume;
75
81
86 size_t frameIndex;
87
93
99
102
104 AudioObject(AudioObject&& rhs) noexcept;
105
106 AudioObject& operator=(AudioObject&& rhs) noexcept;
107
112 double GetPosition() const;
113
119 void SetPosition(double position);
120
125 void Pause();
126
131 void Resume();
132
138 static void DefaultRenderHandler(const Heph::EventParams& eventParams);
139
145 static void MatchFormatRenderHandler(const Heph::EventParams& eventParams);
146 };
147}
#define HEPH_API
Definition HephShared.h:132
class for storing the audio samples in internal format.
Definition AudioBuffer.h:16
class for managing callback functions.
Definition Event.h:25
stores information that's necessary to play audio.
Definition AudioObject.h:36
bool isPaused
Definition AudioObject.h:60
double GetPosition() const
AudioBuffer buffer
Definition AudioObject.h:80
AudioObject(AudioObject &&rhs) noexcept
static void MatchFormatRenderHandler(const Heph::EventParams &eventParams)
Heph::Guid id
Definition AudioObject.h:41
Heph::Event OnRender
Definition AudioObject.h:92
std::string name
Definition AudioObject.h:53
static void DefaultRenderHandler(const Heph::EventParams &eventParams)
std::filesystem::path filePath
Definition AudioObject.h:47
Heph::Event OnFinishedPlaying
Definition AudioObject.h:98
size_t frameIndex
Definition AudioObject.h:86
uint32_t playCount
Definition AudioObject.h:67
double volume
Definition AudioObject.h:74
void SetPosition(double position)
stores the information required to handle an event.
Definition EventParams.h:16
struct for storing globally unique identifiers.
Definition Guid.h:14