issues #6655 Open ai tts issues (#6696)

This commit is contained in:
chenxu9741 2024-07-26 14:55:49 +08:00 • committed by GitHub
commit 6b50bb0fe6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 21 additions and 11 deletions

View file

@ -23,12 +23,13 @@ export default class AudioPlayer {
isPublic: boolean
callback: ((event: string) => {}) | null
constructor(streamUrl: string, isPublic: boolean, msgId: string | undefined, msgContent: string | null | undefined, callback: ((event: string) => {}) | null) {
constructor(streamUrl: string, isPublic: boolean, msgId: string | undefined, msgContent: string | null | undefined, voice: string | undefined, callback: ((event: string) => {}) | null) {
this.audioContext = new AudioContext()
this.msgId = msgId
this.msgContent = msgContent
this.url = streamUrl
this.isPublic = isPublic
this.voice = voice
this.callback = callback
// Compatible with iphone ios17 ManagedMediaSource
@ -154,7 +155,6 @@ export default class AudioPlayer {
this.mediaSource?.endOfStream()
clearInterval(endTimer)
}
console.log('finishStream endOfStream endTimer')
}, 10)
}
@ -169,7 +169,6 @@ export default class AudioPlayer {
const arrayBuffer = this.cacheBuffers.shift()!
this.sourceBuffer?.appendBuffer(arrayBuffer)
}
console.log('finishStream timer')
}, 10)
}