Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ksyeo1010 committed Oct 2, 2024
1 parent 8b42514 commit 35d380d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class AudioPlayerStream {
}

pcmBuffers.append(audioBuffer)

if !engine.isRunning {
try engine.start()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,15 @@ You can download directly to your device or airdrop from a Mac.
prompt: dialog!.prompt(),
completionTokenLimit: 128,
streamCallback: streamCallback)

try dialog!.addLLMResponse(content: result.completion)

DispatchQueue.main.async { [self] in
if result.endpoint == .interrupted {
statusText = "Listening..."
chatText.append(Message(speaker: "You:", msg: ""))
chatState = .STT

promptText = ""
enableGenerateButton = true
} else {
Expand All @@ -248,7 +248,7 @@ You can download directly to your device or airdrop from a Mac.

DispatchQueue.global(qos: .userInitiated).async { [self] in
do {
audioStream!.resetAudioPlayer();
audioStream!.resetAudioPlayer()
let orcaStream = try self.orca!.streamOpen()

var warmup = true
Expand Down Expand Up @@ -299,11 +299,11 @@ You can download directly to your device or airdrop from a Mac.
}
}
}

public func interrupt() {
do {
audioStream!.stopStreamPCM();
try picollm?.interrupt();
audioStream!.stopStreamPCM()
try picollm?.interrupt()
} catch {
DispatchQueue.main.async { [self] in
errorMessage = "\(error.localizedDescription)"
Expand All @@ -327,12 +327,11 @@ You can download directly to your device or airdrop from a Mac.
chatState = .STT
}
}
}
else if chatState == .GENERATE {
} else if chatState == .GENERATE {
let keywordIndex = try self.porcupine!.process(pcm: frame)
if keywordIndex == 0 {
DispatchQueue.main.async { [self] in
self.interrupt();
self.interrupt()
}
}
} else if chatState == .STT {
Expand Down

0 comments on commit 35d380d

Please sign in to comment.