3 #include "AudioTools/AudioCodecs/AudioCodecsBase.h"
4 #include "AudioTools/AudioCodecs/CodecG7xx.h"
62 return decoder.begin();
65 bool begin()
override {
67 return decoder.begin();
70 void end()
override { decoder.end(); }
72 virtual size_t write(
const uint8_t *data,
size_t len)
override {
73 return decoder.write((uint8_t *)data, len);
76 virtual operator bool()
override {
return decoder; }
79 G711_ULAWDecoder decoder;
104 const char *
mime()
override {
return "audio/basic"; }
113 bool begin()
override {
return encoder.begin(); }
116 void end()
override { encoder.end(); }
119 virtual size_t write(
const uint8_t *in_ptr,
size_t in_size)
override {
120 return encoder.write((uint8_t *)in_ptr, in_size);
123 operator bool()
override {
127 bool isOpen() {
return encoder; }
130 G711_ULAWEncoder encoder;