diff options
-rw-r--r-- | apps/talk.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/talk.c b/apps/talk.c index 6629bbb2e5..1854e92cbd 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "file.h" | 27 | #include "file.h" |
28 | #include "buffer.h" | 28 | #include "buffer.h" |
29 | #include "system.h" | 29 | #include "system.h" |
30 | #include "kernel.h" | ||
30 | #include "settings.h" | 31 | #include "settings.h" |
31 | #include "mp3_playback.h" | 32 | #include "mp3_playback.h" |
32 | #include "audio.h" | 33 | #include "audio.h" |
@@ -79,6 +80,7 @@ const char* const file_thumbnail_ext = ".talk"; | |||
79 | #define MAX_THUMBNAIL_BUFSIZE 32768 | 80 | #define MAX_THUMBNAIL_BUFSIZE 32768 |
80 | #endif | 81 | #endif |
81 | 82 | ||
83 | extern bool audio_is_initialized; | ||
82 | 84 | ||
83 | /***************** Data types *****************/ | 85 | /***************** Data types *****************/ |
84 | 86 | ||
@@ -178,6 +180,10 @@ static void load_voicefile(void) | |||
178 | load_size = file_size; | 180 | load_size = file_size; |
179 | #endif | 181 | #endif |
180 | 182 | ||
183 | /* Wait until the audio is initialized before continuing */ | ||
184 | while(!audio_is_initialized) | ||
185 | sleep(HZ/100); | ||
186 | |||
181 | got_size = read(filehandle, audiobuf, load_size); | 187 | got_size = read(filehandle, audiobuf, load_size); |
182 | if (got_size != load_size /* failure */) | 188 | if (got_size != load_size /* failure */) |
183 | goto load_err; | 189 | goto load_err; |