diff options
Diffstat (limited to 'apps/talk.h')
-rw-r--r-- | apps/talk.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/apps/talk.h b/apps/talk.h index 55e7208f1d..28be71884f 100644 --- a/apps/talk.h +++ b/apps/talk.h | |||
@@ -71,6 +71,26 @@ enum { | |||
71 | /* convenience macro to have both virtual pointer and ID as arguments */ | 71 | /* convenience macro to have both virtual pointer and ID as arguments */ |
72 | #define STR(id) ID2P(id), id | 72 | #define STR(id) ID2P(id), id |
73 | 73 | ||
74 | /* Policy values for how hard to try to keep the talk/voice buffers. | ||
75 | * Affects how genereous talk.c is when it's asked for memory in | ||
76 | * shrink_callbacks(). | ||
77 | * | ||
78 | * I.e. setting the policy to TALK_BUFFER_LOOSE, it will happily give its | ||
79 | * entire bufer away if asked for, e.g. due to a another module | ||
80 | * calling core_alloc_maximum(), TALK_BUFFER_HOLD on the other hand will | ||
81 | * make it keep the buffers so that a call to core_alloc_maximum() does not | ||
82 | * stop the speech-interface. | ||
83 | */ | ||
84 | enum talk_buffer_policies { | ||
85 | TALK_BUFFER_DEFAULT, | ||
86 | TALK_BUFFER_LOOSE, | ||
87 | TALK_BUFFER_HOLD, | ||
88 | }; | ||
89 | |||
90 | /* This sets the actual policy. Call this before core_alloc_maximum() to | ||
91 | * get the desired outcome */ | ||
92 | void talk_buffer_set_policy(int policy); | ||
93 | |||
74 | /* publish these strings, so they're stored only once (better than #define) */ | 94 | /* publish these strings, so they're stored only once (better than #define) */ |
75 | extern const char* const dir_thumbnail_name; /* "_dirname.talk" */ | 95 | extern const char* const dir_thumbnail_name; /* "_dirname.talk" */ |
76 | extern const char* const file_thumbnail_ext; /* ".talk" for file voicing */ | 96 | extern const char* const file_thumbnail_ext; /* ".talk" for file voicing */ |
@@ -81,7 +101,6 @@ bool talk_voice_required(void); /* returns true if voice codec required */ | |||
81 | #endif | 101 | #endif |
82 | int talk_get_bufsize(void); /* get the loaded voice file size */ | 102 | int talk_get_bufsize(void); /* get the loaded voice file size */ |
83 | size_t talkbuf_init(char* bufstart); | 103 | size_t talkbuf_init(char* bufstart); |
84 | void talk_buffer_steal(void); /* claim the mp3 buffer e.g. for play/record */ | ||
85 | bool is_voice_queued(void); /* Are there more voice clips to be spoken? */ | 104 | bool is_voice_queued(void); /* Are there more voice clips to be spoken? */ |
86 | int talk_id(int32_t id, bool enqueue); /* play a voice ID from voicefont */ | 105 | int talk_id(int32_t id, bool enqueue); /* play a voice ID from voicefont */ |
87 | /* play a thumbnail from file */ | 106 | /* play a thumbnail from file */ |