35 enum audio_object_format
format;
45 ESPK_LOG(
"audio_object::open()\n");
71 ESPK_LOG(
"audio_object::close()\n");
78 int write(
const void *data,
size_t bytes){
81 ESPK_LOG(
"audio_object::audio_stream_start_callback\n");
87 ESPK_LOG(
"audio_object::write(%d)\n", (
int) bytes);
92 int to_write =
open>1024? 1024 :
open;
93 int result =
p_out_stream->write(((uint8_t*)data)+offset, to_write);
102 ESPK_LOG(
"audio_object::audio_stream_stop_callback\n");
107 uint8_t none[1024]={0};
108 for (
int j=0;j<10;j++){
120 static char errormsg[50] = {0};
121 snprintf(errormsg, 50,
"Error %d", error);
122 return (
const char*)errormsg;
void(* audio_stream_start_callback)()
void espeak_set_audio_output(Print *p)
Defines the audio output.
audio_info espeak_audio_info
audio_info espeak_get_audio_info()
Provides the audio information.
void(* audio_stream_stop_callback)()
void(* audio_stream_factory_callback)(audio_info *cfg)
Callback to define the AudioStream.
info about sample rate and channels and output stream
Definition: audio_object.h:9
int channels
Definition: audio_object.h:11
int sample_rate
Definition: audio_object.h:10
int bits_per_sample
Definition: audio_object.h:12
Print * out
Definition: audio_object.h:13
pcaudiolib implementation for microcontrollers using the arduino Print assigned by espeak_set_audio_o...
Definition: audio_object.h:34
void close()
Definition: audio_object.h:70
bool active
Definition: audio_object.h:42
int drain()
Definition: audio_object.h:100
enum audio_object_format format
Definition: audio_object.h:35
int write(const void *data, size_t bytes)
Definition: audio_object.h:78
const char * strerror(int error)
Definition: audio_object.h:119
Print * p_out_stream
Definition: audio_object.h:40
const char * application_name
Definition: audio_object.h:39
int open(enum audio_object_format format, uint32_t rate, uint8_t channels)
Definition: audio_object.h:44
int flush()
Definition: audio_object.h:115
uint8_t channels
Definition: audio_object.h:37
const char * device
Definition: audio_object.h:38
uint32_t rate
Definition: audio_object.h:36
audio_info cfg
Definition: audio_object.h:41