AUI Framework  master
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
AOpusSoundPipe Class Reference

Sound pipe for OPUS format, decodes OPUS packets. More...

#include <AUI/Audio/Formats/opus/AOpusSoundPipe.h>

Public Member Functions#

void write (const char *src, size_t size) override
 Writes exact size bytes to stream. Blocking (waiting for write all data) is allowed.
 
size_t read (char *dst, size_t size) override
 Reads up to size bytes from stream. Blocking (waiting for new data) is allowed.
 
AAudioFormat info () override
 Get general info about sound stream.
 
bool isLastWriteSuccessful () const
 
- Public Member Functions inherited from IInputStream
size_t read (std::span< std::byte > destination)
 Reads up to destination.size() bytes from stream. Blocking (waiting for new data) is allowed.
 
void readExact (char *dst, size_t size)
 Reads exact size bytes from stream. Blocking (waiting for new data) is allowed.
 
template<typename T>
deserialize ()
 
template<typename T>
IInputStreamoperator>> (T &dst)
 
template<typename T>
IInputStreamoperator>> (T &&dst)
 
- Public Member Functions inherited from IOutputStream
template<typename T>
void write (const T &t)
 
template<typename T>
IOutputStreamoperator<< (const T &t)
 

Static Public Attributes#

static constexpr uint32_t SAMPLE_RATE = 48000
 
static constexpr AChannelFormat CHANNEL_COUNT = AChannelFormat::STEREO
 
static constexpr ASampleFormat SAMPLE_FORMAT = ASampleFormat::I16
 

Additional Inherited Members#

- Static Public Member Functions inherited from ISoundInputStream
static _< ISoundInputStreamfromUrl (const AUrl &url)
 

Detailed Description#

Note
ready packets should be passed with write() method for proper work, header must precede the packets

Member Function Documentation#

◆ info()#

AAudioFormat AOpusSoundPipe::info ( )
overridevirtual
Returns
AAudioFormat containing info about sound stream

Implements ISoundInputStream.

◆ read()#

size_t AOpusSoundPipe::read ( char * dst,
size_t size )
overridevirtual
Sneaky exceptions
An implementation can throw any exception that subclasses AIOException.
Parameters
dstdestination buffer
sizedestination buffer's size. > 0
Returns
number of read bytes (including 0)

Implements IInputStream.

◆ write()#

void AOpusSoundPipe::write ( const char * src,
size_t size )
overridevirtual
Sneaky exceptions
An implementation can throw any exception that subclasses AIOException.
Parameters
srcsource buffer
sizesource buffer's size. > 0

Implements IOutputStream.