mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-28 19:11:03 +08:00
Merge pull request #12821 from Kilo-Org/fix/mac-speech-error-diagnostics
fix(vscode): surface macOS speech capture errors
This commit is contained in:
@@ -46,7 +46,10 @@ function run(args) {
|
||||
const error = Ref()
|
||||
const url = $.NSURL.fileURLWithPath(args[0])
|
||||
const recorder = $.AVAudioRecorder.alloc.initWithURLSettingsError(url, settings, error)
|
||||
if (!recorder || !recorder.prepareToRecord || !recorder.record) throw new Error("Could not start recording")
|
||||
if (!recorder || !recorder.prepareToRecord || !recorder.record) {
|
||||
const description = error[0] && error[0].localizedDescription
|
||||
throw new Error(description ? description.js : "Could not start recording")
|
||||
}
|
||||
console.log("ready")
|
||||
$.NSFileHandle.fileHandleWithStandardInput.readDataToEndOfFile
|
||||
recorder.stop
|
||||
|
||||
@@ -19,6 +19,7 @@ describe("macCaptureArgs", () => {
|
||||
expect(args[3]).toContain("numberWithDouble(16000), $.AVSampleRateKey")
|
||||
expect(args[3]).toContain("numberWithInt(1), $.AVNumberOfChannelsKey")
|
||||
expect(args[3]).toContain("numberWithInt(24000), $.AVEncoderBitRateKey")
|
||||
expect(args[3]).toContain("error[0] && error[0].localizedDescription")
|
||||
expect(args[3]).toContain('console.log("ready")')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user