|
HephAudio v3.1.0
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 (std::shared_ptr< Native::NativeAudio > pNativeAudio) | |
| AudioStream (Audio &audio) | |
| AudioStream (std::shared_ptr< 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 |
| std::shared_ptr< Native::NativeAudio > | GetNativeAudio () const |
| std::shared_ptr< IAudioDecoder > | GetAudioDecoder () const |
| void | SetAudioDecoder (std::shared_ptr< IAudioDecoder > pNewDecoder) |
| AudioObject * | GetAudioObject () const |
| const AudioFormatInfo & | GetAudioFormatInfo () const |
| size_t | GetFrameCount () const |
| void | ChangeFile (const std::filesystem::path &newFilePath) |
| void | CloseFile () |
| void | Start () |
| void | Stop () |
| double | GetPosition () const |
| void | SetPosition (double position) |
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 | ( | std::shared_ptr< Native::NativeAudio > | pNativeAudio | ) |
creates a new instance and initializes it with the provided values.
| pNativeAudio | shared 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 | ( | std::shared_ptr< Native::NativeAudio > | pNativeAudio, |
| const std::filesystem::path & | filePath ) |
creates a new instance and initializes it with the provided values.
| pNativeAudio | shared 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.
| std::shared_ptr< Native::NativeAudio > HephAudio::AudioStream::GetNativeAudio | ( | ) | const |
gets the shared pointer to the native audio instance that's used for rendering audio data.
| std::shared_ptr< IAudioDecoder > HephAudio::AudioStream::GetAudioDecoder | ( | ) | const |
gets the shared pointer to the audio decoder instance.
| void HephAudio::AudioStream::SetAudioDecoder | ( | std::shared_ptr< IAudioDecoder > | pNewDecoder | ) |
sets the decoder.
| pNewDecoder | shared pointer to the new decoder. |
| AudioObject * HephAudio::AudioStream::GetAudioObject | ( | ) | const |
gets the pointer to the audio object 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::CloseFile | ( | ) |
closes the file.
| 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.