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
EncodedAudioBuffer.h
Go to the documentation of this file.
1#pragma once
2#include "HephAudioShared.h"
4#include "AudioFormatInfo.h"
5
8namespace HephAudio
9{
14 class HEPH_API EncodedAudioBuffer : protected Heph::BufferBase<EncodedAudioBuffer, uint8_t>
15 {
16 friend class Heph::BufferBase<EncodedAudioBuffer, uint8_t>; // BufferBase cannot access its own members from inherited methods for some reason.
17
18 public:
19 using Heph::BufferBase<EncodedAudioBuffer, uint8_t>::Size;
20 using Heph::BufferBase<EncodedAudioBuffer, uint8_t>::Resize;
21 using Heph::BufferBase<EncodedAudioBuffer, uint8_t>::begin;
22 using Heph::BufferBase<EncodedAudioBuffer, uint8_t>::end;
23
24 protected:
30
31 public:
34
40 explicit EncodedAudioBuffer(const AudioFormatInfo& formatInfo);
41
48 EncodedAudioBuffer(size_t size, const AudioFormatInfo& formatInfo);
49
57 EncodedAudioBuffer(const uint8_t* pData, size_t size, const AudioFormatInfo& formatInfo);
58
61
64
66 virtual ~EncodedAudioBuffer() = default;
67
68 EncodedAudioBuffer& operator=(const EncodedAudioBuffer&) = delete;
69 EncodedAudioBuffer& operator=(EncodedAudioBuffer&& rhs) noexcept;
70 virtual void Release() override;
71
77
82 void SetAudioFormatInfo(const AudioFormatInfo& newFormatInfo);
83
90 void Add(const uint8_t* pData, size_t size);
91 };
92}
#define HEPH_API
Definition HephShared.h:132
stores encoded audio data.
Definition EncodedAudioBuffer.h:15
EncodedAudioBuffer(size_t size, const AudioFormatInfo &formatInfo)
virtual ~EncodedAudioBuffer()=default
void SetAudioFormatInfo(const AudioFormatInfo &newFormatInfo)
EncodedAudioBuffer(const AudioFormatInfo &formatInfo)
void Add(const uint8_t *pData, size_t size)
AudioFormatInfo formatInfo
Definition EncodedAudioBuffer.h:29
EncodedAudioBuffer(const EncodedAudioBuffer &)=delete
const AudioFormatInfo & GetAudioFormatInfo() const
EncodedAudioBuffer(EncodedAudioBuffer &&rhs) noexcept
EncodedAudioBuffer(const uint8_t *pData, size_t size, const AudioFormatInfo &formatInfo)
virtual void Release() override
base class for buffers. Provides basic buffer operations and methods.
Definition BufferBase.h:31
stores the properties of the audio signals
Definition AudioFormatInfo.h:20