fix: address talk streaming build

This commit is contained in:
Peter Steinberger
2025-12-30 12:20:32 +01:00
parent 27adfb76fa
commit 9df22c0093
2 changed files with 5 additions and 4 deletions

View File

@@ -500,7 +500,7 @@ actor TalkModeRuntime {
if let apiKey, !apiKey.isEmpty, let voiceId {
let desiredOutputFormat = directive?.outputFormat ?? self.defaultOutputFormat ?? "pcm_44100"
let outputFormat = ElevenLabsTTSClient.validatedOutputFormat(desiredOutputFormat)
if outputFormat == nil, let desiredOutputFormat, !desiredOutputFormat.isEmpty {
if outputFormat == nil, !desiredOutputFormat.isEmpty {
self.logger
.warning(
"talk output_format unsupported for local playback: \(desiredOutputFormat, privacy: .public)")
@@ -639,11 +639,12 @@ actor TalkModeRuntime {
}
func stopSpeaking(reason: TalkStopReason) async {
let usePCM = self.lastPlaybackWasPCM
let interruptedAt = await MainActor.run {
let primary = self.lastPlaybackWasPCM
let primary = usePCM
? PCMStreamingAudioPlayer.shared.stop()
: StreamingAudioPlayer.shared.stop()
_ = self.lastPlaybackWasPCM
_ = usePCM
? StreamingAudioPlayer.shared.stop()
: PCMStreamingAudioPlayer.shared.stop()
return primary

View File

@@ -143,7 +143,7 @@ private final class Playback: @unchecked Sendable {
return
}
self.enqueueCurrentBuffer(flushOnly: true)
self.stop(immediate: false)
_ = self.stop(immediate: false)
}
}