12 #ifndef ROC_AUDIO_PCM_ENCODER_H_
13 #define ROC_AUDIO_PCM_ENCODER_H_
36 virtual void begin(
void* frame,
size_t frame_size);
46 const size_t n_chans_;
49 size_t frame_byte_size_;
50 size_t frame_bit_off_;
Audio frame encoder interface.
PcmEncoder(const SampleSpec &sample_spec)
Initialize.
virtual size_t write(const sample_t *samples, size_t n_samples)
Encode samples.
virtual size_t encoded_byte_count(size_t num_samples) const
Get encoded frame size in bytes for given number of samples per channel.
virtual void begin(void *frame, size_t frame_size)
Start encoding a new frame.
virtual void end()
Finish encoding frame.
static IFrameEncoder * construct(core::IArena &arena, const SampleSpec &sample_spec)
Construction function.
PCM format mapper. Convert between PCM formats.
Sample specification. Describes sample rate and channels.
Base class for non-copyable objects.
Audio frame encoder interface.
float sample_t
Raw audio sample.