moeru-ai/airi · error · Error
File input is required for transcription.
Error message
File input is required for transcription.
What it means
The non-streaming transcription path calls generateTranscription, which requires normalizedInput.file. When the caller supplied no file — only a stream input on a provider without stream support, or nothing at all after input normalization — this precondition throws before any provider request is made. It is the plain 'you gave me no audio file' guard for generate-mode STT.
Source
Thrown at packages/stage-ui/src/stores/modules/hearing.ts:499
if (features.supportsStreamInput && !normalizedInput.inputAudioStream && normalizedInput.file) {
const streamResult = streamExecutor({
...request,
file: normalizedInput.file,
} as Parameters<typeof streamExecutor>[0])
emitSucceeded(0, true)
return {
mode: 'stream',
...streamResult,
}
}
if (!features.supportsGenerate || !normalizedInput.file) {
throw new Error('No compatible input provided for streaming transcription.')
}
}
if (!normalizedInput.file) {
throw new Error('File input is required for transcription.')
}
const useVerboseJson = !format && confidenceThreshold.value > CONFIDENCE_THRESHOLD_DISABLED
const response = await generateTranscription({
...provider.transcription(model, options?.providerOptions),
file: normalizedInput.file,
fileName: resolveTranscriptionFileName(normalizedInput.file, normalizedInput.fileName),
responseFormat: useVerboseJson ? 'verbose_json' : format,
})
if (useVerboseJson) {
if (response.segments) {
verboseJsonNotSupported.value = false
const filteredText = filterTranscriptionByConfidence(response.segments, confidenceThreshold.value)
emitSucceeded(filteredText.length, false)
return {
mode: 'generate',
...response,View on GitHub (pinned to f679616c34)
Solutions
- Produce and pass a file: record the audio to a Blob/File before calling transcription.
- Choose a provider that supports stream input when you only have a live stream.
- Validate that a file exists in normalized input before invoking transcription and surface a capture error early.
- Fix the recording pipeline when it silently yields no file.
Example fix
// before
const result = await hearing.transcribe(model, {})
// after
if (!recordedBlob) {
toast.info('No recorded audio to transcribe')
return
}
const result = await hearing.transcribe(model, { file: recordedBlob }) Defensive patterns
Strategy: validation
Validate before calling
if (!input.file) {
toast.info('No recorded audio to transcribe')
return
}
await hearing.transcribe(model, { file: input.file }) Type guard
function hasTranscribableFile(input: unknown): input is { file: Blob } {
return typeof input === 'object' && input !== null
&& input.file instanceof Blob
&& input.file.size > 0
} Try / catch
try {
const result = await hearing.transcribe(model, input)
}
catch (error) {
if (errorMessageFrom(error) === 'File input is required for transcription.') {
// capture produced nothing: reset the recorder instead of showing a hard error
resetRecorder()
return
}
throw error
} Prevention
- Ensure the recorder emits a non-empty Blob before enabling transcription.
- Match the input type to provider capabilities: files for generate-only providers, streams for stream-input providers.
- Validate normalized input in the hearing pipeline before dispatching to the provider.
- Log capture-layer errors instead of swallowing them so empty files are diagnosable.
When it happens
Trigger: Using a generate-only (non-stream) STT provider while only an inputAudioStream is available; microphone recording failing so no Blob/File was produced; calling transcribe with only options and no audio input; a file-only provider receiving a stream-oriented request object.
Common situations: Live-mic flows wired to providers that only support batch file transcription; audio recorder errors swallowed upstream so downstream sees an empty input; programmatic use of the hearing store without attaching captured audio.
Related errors
- No compatible input provided for streaming transcription.
- No audio file provided for transcription.
- Web Speech API is not available in this environment. It requ
- MiMo voice clone requires a base64 audio sample in data URI
- MiMo voice design requires a style prompt in the user messag
AI-assisted analysis of moeru-ai/airi@f679616c34 (2026-08-18).
Data as JSON: /api/errors/9af7cf51ee1fb622.
Report an issue: GitHub.