diff --git a/apps/talk.c b/apps/talk.c index a11f830665..ed262b8094 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -778,6 +778,7 @@ void talk_buffer_steal(void) int talk_id(int32_t id, bool enqueue) { long clipsize; + size_t temp; unsigned char* clipbuf; int32_t unit; int decimals; @@ -789,8 +790,12 @@ int talk_id(int32_t id, bool enqueue) return -1; #endif + /* try to get audio buffer until talkbuf_init() is called */ + if (!voicebuf) + voicebuf = audio_get_buffer(true, &temp); + if (p_voicefile == NULL && has_voicefile) - load_voicefile(false, voicebuf, voicefile_size); /* reload needed */ + load_voicefile(false, voicebuf, MIN(voicefile_size,temp)); /* reload needed */ if (p_voicefile == NULL) /* still no voices? */ return -1;