{"record":{"id":"eed91d4d0c7410cb","repo":"moeru-ai/airi","slug":"no-audio-input-device-selected","errorCode":null,"errorMessage":"No audio input device selected","messagePattern":"No audio input device selected","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/stage-pages/src/pages/settings/modules/hearing.vue","lineNumber":146,"sourceCode":"    const message = errorMessageFrom(cause) ?? t('settings.pages.modules.hearing.sections.section.playground.transcription-failed')\n    finishError(metadata, message)\n    error.value = message\n  },\n})\n\nconst isSpeechVolume = shallowRef(false) // Volume-based speaking detection\nconst isSpeech = computed(() => {\n  if (useVADModel.value && loadedVAD.value) {\n    return isSpeechVAD.value\n  }\n\n  return isSpeechVolume.value\n})\n\nasync function setupAudioMonitoring() {\n  try {\n    if (!selectedAudioInput.value) {\n      console.warn('No audio input device selected')\n      return false\n    }\n\n    await stopAudioMonitoring()\n\n    await startStream()\n    if (!stream.value) {\n      console.warn('No audio stream available')\n      return false\n    }\n\n    if (supportsStreamInput.value) {\n      // The Hearing pipeline owns speech segmentation and the provider session.\n      // The page VAD below only drives the visualization for streaming providers.\n      await transcribeForMediaStream(stream.value, {\n        consumerId: hearingPlaygroundTranscriptionConsumerId,\n        onSpeechEnd: finishStreaming,\n        onTranscriptionUpdate: replaceStreamingText,","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/moeru-ai/airi/blob/677329427f32468c74b17f3ec47eeca4e05bec65/packages/stage-pages/src/pages/settings/modules/hearing.vue#L128-L164","documentation":"Hearing settings playground guard: setupAudioMonitoring() bails out with this warn (returning false) when selectedAudioInput is empty, before startStream() is attempted. The device list can be empty because enumerateDevices has not run yet, device labels/IDs are hidden until microphone permission is granted, the user chose nothing, or the machine has no input device.","triggerScenarios":"Opening the hearing settings module before the onMounted askPermission() resolves and devices are enumerated; permission never granted so enumerateDevices returns label-less entries; no microphone hardware; selectedAudioInput cleared after the chosen device disconnects.","commonSituations":"First visit racing the permission flow; revoked microphone permission; headless/VM environments without audio input; device unplugged between sessions leaving a stale empty selection.","solutions":["Ensure askPermission() completed so navigator.mediaDevices.enumerateDevices() returns real device IDs","Pick a device in the Audio Input Device combobox, or auto-select the first audioinput once the list loads","Confirm the OS exposes a microphone to the browser (system privacy settings)","After unplugging a device, re-select a valid one - the empty selection will keep skipping setup"],"exampleFix":"// before\nif (!selectedAudioInput.value) {\n  console.warn('No audio input device selected')\n  return false\n}\n\n// after - auto-pick the first available input\nif (!selectedAudioInput.value) {\n  const devices = await navigator.mediaDevices.enumerateDevices()\n  const first = devices.find(d => d.kind === 'audioinput')\n  if (!first)\n    return false\n  selectedAudioInput.value = first.deviceId\n}","handlingStrategy":"validation","validationCode":"if (!selectedAudioInput.value) {\n  const devices = await navigator.mediaDevices.enumerateDevices()\n  const first = devices.find(d => d.kind === 'audioinput')\n  if (!first)\n    return false\n  selectedAudioInput.value = first.deviceId\n}\nreturn await setupAudioMonitoring()","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Populate the device combobox after permission is granted so real IDs are listed","Auto-select a default input instead of leaving the selection empty","Re-validate the stored device ID against enumerateDevices after device changes"],"tags":["audio-input","device-selection","settings","enumeratedevices"],"backgroundTag":"no-audio-input-device","analyzedSha":"677329427f32468c74b17f3ec47eeca4e05bec65","analyzedAt":"2026-08-18T17:29:58.153Z","contentChangedAt":"2026-08-18T17:29:58.153Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}