issues #6655 Open ai tts issues (#6696)

This commit is contained in:
chenxu9741
2024-07-26 14:55:49 +08:00
committed by GitHub
parent 80b3871c55
commit 6b50bb0fe6
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)
}