mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
Merge pull request #416 from chriswritescode-dev/fix/tts-overlap-and-cache-race
fix(tts): prevent overlapping playback and corrupted audio cache
This commit is contained in:
9 files changed
+1145
-167
No files matched your search
@@ -11,6 +11,10 @@ export interface TTSVoicesResponse {
|
||||
cached: boolean
|
||||
}
|
||||
|
||||
export interface TTSClearCacheResponse {
|
||||
cleared: number
|
||||
}
|
||||
|
||||
export interface TTSStatusResponse {
|
||||
enabled: boolean
|
||||
configured: boolean
|
||||
@@ -42,6 +46,12 @@ export const ttsApi = {
|
||||
})
|
||||
},
|
||||
|
||||
clearCache: async (): Promise<TTSClearCacheResponse> => {
|
||||
return fetchWrapper(`${API_BASE_URL}/api/tts/cache`, {
|
||||
method: 'DELETE',
|
||||
})
|
||||
},
|
||||
|
||||
synthesize: async (text: string, userId = 'default', signal?: AbortSignal): Promise<Blob> => {
|
||||
return fetchWrapperBlob(`${API_BASE_URL}/api/tts/synthesize`, {
|
||||
method: 'POST',
|
||||
|
||||
Reference in new issue
Block a user