Merge pull request #12821 from Kilo-Org/fix/mac-speech-error-diagnostics

fix(vscode): surface macOS speech capture errors
This commit is contained in:
Marius
2026-08-07 14:30:26 +02:00
committed by GitHub
2 changed files with 5 additions and 1 deletions
@@ -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")')
})
})