{"record":{"id":"7f7436170836c778","repo":"microsoft/VibeVoice","slug":"audio-input-is-required","errorCode":null,"errorMessage":"Audio input is required","messagePattern":"Audio input is required","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vibevoice/processor/vibevoice_tokenizer_processor.py","lineNumber":143,"sourceCode":"        \"\"\"\n        Process audio for VibeVoice models.\n        \n        Args:\n            audio: Audio input(s) to process. Can be:\n                - str: Path to audio file\n                - np.ndarray: Audio array\n                - List[float]: Audio as list of floats\n                - List[np.ndarray]: Batch of audio arrays\n                - List[str]: Batch of audio file paths\n            sampling_rate (int, optional): Sampling rate of the input audio\n            return_tensors (str, optional): Return format ('pt' for PyTorch, 'np' for NumPy)\n            \n        Returns:\n            dict: Processed audio inputs with keys:\n                - input_features: Audio tensor(s) ready for the model\n        \"\"\"\n        if audio is None:\n            raise ValueError(\"Audio input is required\")\n        \n        # Validate sampling rate\n        if sampling_rate is not None and sampling_rate != self.sampling_rate:\n            logger.warning(\n                f\"Input sampling rate ({sampling_rate}) differs from expected \"\n                f\"sampling rate ({self.sampling_rate}). Please resample your audio.\"\n            )\n        \n        # Handle different input types\n        if isinstance(audio, str):\n            # Single audio file path\n            audio = self._load_audio_from_path(audio)\n            is_batched = False\n        elif isinstance(audio, list):\n            if len(audio) == 0:\n                raise ValueError(\"Empty audio list provided\")\n            \n            # Check if it's a list of file paths","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/microsoft/VibeVoice/blob/94da20d98b2fa7688e9cbfaf7692ddb4954f7600/vibevoice/processor/vibevoice_tokenizer_processor.py#L125-L161","documentation":"VibeVoiceTokenizerProcessor.__call__ requires an audio argument; None is rejected before any type dispatch (path vs array vs list) begins. The tokenizer processor exists to turn waveforms into model input features, so there is no meaningful default when audio is absent.","triggerScenarios":"Calling processor() with no arguments or processor(audio=None), typically via a wrapper that forwards an optional keyword that was never populated.","commonSituations":"Building input dicts programmatically (inputs = {}; if use_voice: inputs['audio'] = ...) and then calling processor(**inputs) with the key absent; test harnesses with unfixed fixtures.","solutions":["Supply audio as a file path (.wav/.mp3/...), a 1D/2D NumPy array, or a list of either.","Fix wrappers so audio is a required positional, or assert it is present before the call.","In test harnesses, default to a small sine-wave array rather than None."],"exampleFix":"# before\nenc = tok_processor(audio=voice.get('audio'))  # dict missing key -> None\n\n# after\nenc = tok_processor(audio=voice['audio'])  # KeyError surfaces at the real source","handlingStrategy":"validation","validationCode":"if audio is None:\n    raise ValueError('audio argument missing — check your input dict before calling')\nenc = tokenizer_processor(audio=audio)","typeGuard":"def has_audio(audio) -> bool:\n    return audio is not None","tryCatchPattern":"try:\n    enc = tokenizer_processor(audio=audio)\nexcept ValueError as e:\n    if 'Audio input is required' in str(e):\n        raise ValueError('pipeline bug: audio was never loaded') from e\n    raise","preventionTips":["Treat audio as a required positional argument in wrapper functions.","Use dict['audio'] (raises KeyError at the source) instead of dict.get('audio') for required inputs.","Validate batch inputs against the manifest so missing items are caught early."],"tags":["audio","validation","input-validation","tokenizer"],"backgroundTag":null,"analyzedSha":"94da20d98b2fa7688e9cbfaf7692ddb4954f7600","analyzedAt":"2026-08-15T04:12:07.418Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}