HephAudio v3.0.6
A cross-platform C++ library for recording, playing, and processing audio on Windows, Android, Linux, iOS, and macOS.
|
Class for playing audio files without loading them into memory. Reads the portion of audio data from the file just before rendering. More...
#include <AudioStream.h>
Public Member Functions | |
AudioStream (Native::NativeAudio *pNativeAudio) | |
AudioStream (Audio &audio) | |
AudioStream (Native::NativeAudio *pNativeAudio, const std::filesystem::path &filePath) | |
AudioStream (Audio &audio, const std::filesystem::path &filePath) | |
AudioStream (const AudioStream &)=delete | |
AudioStream (AudioStream &&rhs) noexcept | |
~AudioStream () | |
AudioStream & | operator= (const AudioStream &)=delete |
AudioStream & | operator= (AudioStream &&rhs) noexcept |
Native::NativeAudio * | GetNativeAudio () const |
AudioObject * | GetAudioObject () const |
const AudioFormatInfo & | GetAudioFormatInfo () const |
size_t | GetFrameCount () const |
void | ChangeFile (const std::filesystem::path &newFilePath) |
void | Start () |
void | Stop () |
double | GetPosition () const |
void | SetPosition (double position) |
void | Release () |
Class for playing audio files without loading them into memory. Reads the portion of audio data from the file just before rendering.
HephAudio::AudioStream::AudioStream | ( | Native::NativeAudio * | pNativeAudio | ) |
creates a new instance and initializes it with the provided values.
pNativeAudio | pointer to the native audio instance that will be used for playing the files. |
HephAudio::AudioStream::AudioStream | ( | Audio & | audio | ) |
creates a new instance and initializes it with the provided values.
audio | the audio instance that will be used for playing the files. |
HephAudio::AudioStream::AudioStream | ( | Native::NativeAudio * | pNativeAudio, |
const std::filesystem::path & | filePath ) |
creates a new instance and initializes it with the provided values.
pNativeAudio | pointer to the native audio instance that will be used for playing the files. |
filePath | file that will be played. |
HephAudio::AudioStream::AudioStream | ( | Audio & | audio, |
const std::filesystem::path & | filePath ) |
creates a new instance and initializes it with the provided values.
audio | the audio instance that will be used for playing the files. |
filePath | file that will be played. |
|
noexcept |
creates a new instance and moves the rhs's data to it.
rhs | instance whose data will be moved. |
HephAudio::AudioStream::~AudioStream | ( | ) |
releases the resources and destroys the instance.
Native::NativeAudio * HephAudio::AudioStream::GetNativeAudio | ( | ) | const |
gets the pointer to the NativeAudio instance that's used for rendering audio data.
AudioObject * HephAudio::AudioStream::GetAudioObject | ( | ) | const |
gets the pointer to the AudioObject instance that's created to play audio data.
const AudioFormatInfo & HephAudio::AudioStream::GetAudioFormatInfo | ( | ) | const |
gets the format info of the audio data.
size_t HephAudio::AudioStream::GetFrameCount | ( | ) | const |
gets the number of audio frames the file contains.
void HephAudio::AudioStream::ChangeFile | ( | const std::filesystem::path & | newFilePath | ) |
changes the file that's currently playing with the provided one.
void HephAudio::AudioStream::Start | ( | ) |
starts (resumes) playing the file.
void HephAudio::AudioStream::Stop | ( | ) |
stops (pauses) playing the file.
double HephAudio::AudioStream::GetPosition | ( | ) | const |
gets the position of the frame that will be rendered next between 0 and 1.
void HephAudio::AudioStream::SetPosition | ( | double | position | ) |
sets the position of the frame that will be rendered next between 0 and 1.
void HephAudio::AudioStream::Release | ( | ) |
releases the resources.