{"record":{"id":"1ff4f754325a9cbb","repo":"babysor/MockingBird","slug":"unable-to-import-webrtcvad-this-package-enables","errorCode":null,"errorMessage":"Unable to import 'webrtcvad'. This package enables noise removal and is recommended.","messagePattern":"Unable to import 'webrtcvad'\\. This package enables noise removal and is recommended\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"models/encoder/audio.py","lineNumber":13,"sourceCode":"from scipy.ndimage.morphology import binary_dilation\nfrom models.encoder.params_data import *\nfrom pathlib import Path\nfrom typing import Optional, Union\nfrom warnings import warn\nimport numpy as np\nimport librosa\nimport struct\n\ntry:\n    import webrtcvad\nexcept:\n    warn(\"Unable to import 'webrtcvad'. This package enables noise removal and is recommended.\")\n    webrtcvad=None\n\nint16_max = (2 ** 15) - 1\n\n\ndef preprocess_wav(fpath_or_wav: Union[str, Path, np.ndarray],\n                   source_sr: Optional[int] = None,\n                   normalize: Optional[bool] = True,\n                   trim_silence: Optional[bool] = True):\n    \"\"\"\n    Applies the preprocessing operations used in training the Speaker Encoder to a waveform \n    either on disk or in memory. The waveform will be resampled to match the data hyperparameters.\n\n    :param fpath_or_wav: either a filepath to an audio file (many extensions are supported, not \n    just .wav), either the waveform as a numpy array of floats.\n    :param source_sr: if passing an audio waveform, the sampling rate of the waveform before \n    preprocessing. After preprocessing, the waveform's sampling rate will match the data \n    hyperparameters. If passing a filepath, the sampling rate will be automatically detected and ","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/models/encoder/audio.py#L1-L31","documentation":"Error \"Unable to import 'webrtcvad'. This package enables noise removal and is recommended.\" thrown in babysor/MockingBird.","triggerScenarios":"Thrown at models/encoder/audio.py:13 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}