Zao SDK for Jetson / libzep API Reference
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Classes | Enumerations | Functions | Variables
zep::audio Namespace Reference

Namespace for all audio related elements. More...

Classes

class  FactoryInterface
 factory function interface for audio related streams More...
 
class  PcmBufferPoolInterface
 PCM buffer pool interface. More...
 
class  PcmBufferPoolReaderInterface
 PCM buffer pool reader interface. More...
 
class  PcmBufferPoolWriterInterface
 PCM buffer pool writer interface. More...
 
class  PcmBufferReader
 Reader implementation of PCM buffer. More...
 
class  PcmBufferWriter
 Writer implementation of PCM buffer. More...
 
class  PcmFormat
 PCM audio format. More...
 
class  PcmSinkCallbackInterface
 PCMによる音声シンク機能のコールバックインターフェース More...
 
class  PcmSinkInterface
 PCMによる音声シンク機能インターフェース More...
 
class  PcmSourceCallbackInterface
 Callback interface for voice source functionality with PCM. More...
 
class  PcmSourceInterface
 Audio source function interface with PCM. More...
 

Enumerations

enum  ChannelBits : unsigned { kLeftChannel = (1u << 0) , kRightChannel , kStereo }
 Channel mask value definition.
 

Functions

std::shared_ptr< PcmBufferPoolInterfaceCreatePcmBufferPool (std::size_t samples_per_buffer, std::size_t num_of_buffers)
 Build PCM buffer pool.
 
class zep::audio::PcmBufferReader PcmBufferReader (const PcmBufferReader &)=delete
 
PcmBufferReaderoperator= (const PcmBufferReader &)=delete
 
 ~PcmBufferReader () noexcept
 Destroy PcmBufferReader object.
 
bool IsValid () const noexcept
 Get whether or not a valid buffer is held.
 
 operator bool () const noexcept
 Get whether or not a valid buffer is held.
 
const std::int16_t * GetPointer () const noexcept
 Get the first pointer to the managed buffer.
 
std::size_t GetReadableSamples () const noexcept
 Get the number of valid samples.
 
TimestampInterface::Rep GetHeadTimestamp () const noexcept
 Get the leading timestamp.
 
void Finalize () noexcept
 Notify the completion of reading data from the buffer.
 
void SetSamplingRate (int new_value) noexcept
 Set sampling rate (in Hz).
 
unsigned GetChannelMask () const noexcept
 Get the channel mask.
 
void SetChannelMask (unsigned new_value) noexcept
 Set the channel mask.
 
int GetNumOfChannels () const noexcept
 Get the number of channels.
 

Variables

enum zep::audio::ChannelBits GetSamplingRate () const noexcept
 Get sampling rate (in Hz).
 

Detailed Description

Namespace for all audio related elements.

音声関係の要素をまとめた名前空間

Function Documentation

◆ CreatePcmBufferPool()

std::shared_ptr< PcmBufferPoolInterface > zep::audio::CreatePcmBufferPool ( std::size_t  samples_per_buffer,
std::size_t  num_of_buffers 
)

Build PCM buffer pool.

PCMバッファプールを構築する。

Parameters
samples_per_bufferNumber of samples per buffer
num_of_buffersNumber of buffers
Parameters
samples_per_buffer1バッファあたりのサンプル数
num_of_buffersバッファの数

◆ Finalize()

void zep::audio::Finalize ( )
inlinenoexcept

Notify the completion of reading data from the buffer.

Note
After calling this function, the pointer returned by GetPointer()
After calling this function, the pointer returned by GetPointer() must not be accessed.
Postcondition
IsValid() == false

◆ GetChannelMask()

unsigned zep::audio::GetChannelMask ( ) const
noexcept

Get the channel mask.

Attention
Different from the number of channels.
See also
GetNumOfChannels().

◆ GetNumOfChannels()

int zep::audio::GetNumOfChannels ( ) const
noexcept

Get the number of channels.

Note
Equal to the number of 1 bits in the channel mask.

◆ GetPointer()

const std::int16_t * zep::audio::GetPointer ( ) const
noexcept

Get the first pointer to the managed buffer.

Return values
nullptrno managed buffer
non-nullptrFirst pointer to managed buffer

◆ GetReadableSamples()

std::size_t zep::audio::GetReadableSamples ( ) const
noexcept

Get the number of valid samples.

Note
The number of samples is the total number of samples for all channels, not for each channel.
The unit is the number of samples, not the number of bytes.
Return values
0no valid element (including cases where no valid buffer is kept).

◆ IsValid()

bool zep::audio::IsValid ( ) const
noexcept

Get whether or not a valid buffer is held.

Return values
trueholds a valid buffer
falseNo valid buffer is retained

◆ operator bool()

zep::audio::operator bool ( ) const
explicitnoexcept

Get whether or not a valid buffer is held.

See also
IsValid()
Return values
trueholds a valid buffer
falseDoes not hold a valid buffer

◆ SetChannelMask()

void zep::audio::SetChannelMask ( unsigned  new_value)
noexcept

Set the channel mask.

Parameters
new_valuechannel_mask(bit0=Left, bit1=Right)

◆ SetSamplingRate()

void zep::audio::SetSamplingRate ( int  new_value)
noexcept

Set sampling rate (in Hz).

Parameters
new_valueSampling rate [Hz].