{"record":{"id":"6ea321d9b86e697d","repo":"microsoft/VibeVoice","slug":"audio-input-is-required-for-asr-processing","errorCode":null,"errorMessage":"Audio input is required for ASR processing","messagePattern":"Audio input is required for ASR processing","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vibevoice/processor/vibevoice_asr_processor.py","lineNumber":234,"sourceCode":"            return_tensors: Output format ('pt' for PyTorch, 'np' for NumPy)\n            padding: Whether to pad batch inputs\n            max_length: Maximum sequence length\n            truncation: Whether to truncate long sequences\n            add_generation_prompt: Whether to add generation prompt for inference\n            use_streaming: Whether to use streaming mode (True by default, auto False if <60s)\n            context_info: Optional context information (e.g., hotwords, metadata) to help transcription\n            \n        Returns:\n            BatchEncoding with:\n                - input_ids: Token IDs for the model\n                - attention_mask: Attention mask\n                - acoustic_input_mask: Mask indicating speech token positions\n                - speech_tensors: Processed speech features\n                - speech_masks: Valid speech masks\n                - vae_tok_seqlens: Length of each speech segment in tokens\n        \"\"\"\n        if audio is None:\n            raise ValueError(\"Audio input is required for ASR processing\")\n        \n        # Handle single vs batch input\n        if isinstance(audio, list):\n            is_batched = True\n            audio_list = audio\n        else:\n            is_batched = False\n            audio_list = [audio]\n        \n        # Process each audio input\n        all_encodings = []\n        for audio_input in audio_list:\n            encoding = self._process_single_audio(\n                audio_input,\n                sampling_rate=sampling_rate,\n                add_generation_prompt=add_generation_prompt,\n                use_streaming=use_streaming,\n                context_info=context_info,","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/microsoft/VibeVoice/blob/94da20d98b2fa7688e9cbfaf7692ddb4954f7600/vibevoice/processor/vibevoice_asr_processor.py#L216-L252","documentation":"The ASR processor's __call__ requires actual speech: without an audio signal there are no acoustic tokens to build, so passing audio=None fails fast with this ValueError before any tokenization happens. Text-only input is not meaningful for ASR.","triggerScenarios":"Calling processor(text=..., audio=None), calling processor() with no arguments, or forwarding a variable that was never assigned (e.g. audio loaded conditionally and the load branch was skipped).","commonSituations":"Adapting TTS-style example code (where audio is optional and only used for voice cloning) to the ASR processor; a data pipeline where the audio path was missing from a manifest so the loader silently produced None.","solutions":["Pass a valid audio argument: a file path, NumPy array at the expected sample rate, or a list of them for batch input.","If audio comes from a loader, make the loader raise on missing files instead of returning None.","For pure text encoding needs, use the underlying tokenizer directly rather than the ASR processor."],"exampleFix":"# before\nenc = asr_processor(text='hello', audio=maybe_audio)  # maybe_audio is None\n\n# after\nif maybe_audio is None:\n    raise FileNotFoundError('audio segment missing from manifest')\nenc = asr_processor(text='hello', audio=maybe_audio)","handlingStrategy":"validation","validationCode":"if audio is None:\n    raise ValueError(f'no audio for sample {sample_id}')  # surface at data source\nenc = asr_processor(text=transcript_hint, audio=audio)","typeGuard":"def has_valid_audio(audio) -> bool:\n    return audio is not None and (isinstance(audio, (str,)) or getattr(audio, 'size', 1) > 0)","tryCatchPattern":"try:\n    enc = asr_processor(text=t, audio=a)\nexcept ValueError as e:\n    if 'Audio input is required' in str(e):\n        logger.error(f'skipping sample with missing audio: {sample_id}')\n        continue\n    raise","preventionTips":["Make audio loaders raise on missing files instead of returning None.","Assert audio is not None at the data-manifest boundary, not inside model code.","Distinguish TTS calls (audio optional) from ASR calls (audio required) in shared wrappers."],"tags":["asr","validation","audio","input-validation"],"backgroundTag":null,"analyzedSha":"94da20d98b2fa7688e9cbfaf7692ddb4954f7600","analyzedAt":"2026-08-15T04:12:07.418Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}