{"record":{"id":"6e1e9daa45da4a4a","repo":"babysor/MockingBird","slug":"package-webrtcvad-not-found-this-package-enable","errorCode":null,"errorMessage":"Package 'webrtcvad' not found. This package enables noise removal and is recommended. Please install and try again. If installation fails, use --no_trim to disable this error message.","messagePattern":"Package 'webrtcvad' not found\\. This package enables noise removal and is recommended\\. Please install and try again\\. If installation fails, use --no_trim to disable this error message\\.","errorType":"exception","errorClass":"ModuleNotFoundError","httpStatus":null,"severity":"error","filePath":"control/cli/encoder_preprocess.py","lineNumber":41,"sourceCode":"        \"defaults to <datasets_root>/SV2TTS/encoder/\")\n    parser.add_argument(\"-d\", \"--datasets\", type=str, \n                        default=\"librispeech_other,voxceleb1,aidatatang_200zh\", help=\\\n        \"Comma-separated list of the name of the datasets you want to preprocess. Only the train \"\n        \"set of these datasets will be used. Possible names: librispeech_other, voxceleb1, \"\n        \"voxceleb2.\")\n    parser.add_argument(\"-s\", \"--skip_existing\", action=\"store_true\", help=\\\n        \"Whether to skip existing output files with the same name. Useful if this script was \"\n        \"interrupted.\")\n    parser.add_argument(\"--no_trim\", action=\"store_true\", help=\\\n        \"Preprocess audio without trimming silences (not recommended).\")\n    args = parser.parse_args()\n\n    # Verify webrtcvad is available\n    if not args.no_trim:\n        try:\n            import webrtcvad\n        except:\n            raise ModuleNotFoundError(\"Package 'webrtcvad' not found. This package enables \"\n                \"noise removal and is recommended. Please install and try again. If installation fails, \"\n                \"use --no_trim to disable this error message.\")\n    del args.no_trim\n\n    # Process the arguments\n    args.datasets = args.datasets.split(\",\")\n    if not hasattr(args, \"out_dir\"):\n        args.out_dir = args.datasets_root.joinpath(\"SV2TTS\", \"encoder\")\n    assert args.datasets_root.exists()\n    args.out_dir.mkdir(exist_ok=True, parents=True)\n\n    # Preprocess the datasets\n    print_args(args, parser)\n    preprocess_func = {\n        \"librispeech_other\": preprocess_librispeech,\n        \"voxceleb1\": preprocess_voxceleb1,\n        \"voxceleb2\": preprocess_voxceleb2,\n        \"aidatatang_200zh\": preprocess_aidatatang_200zh,","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/control/cli/encoder_preprocess.py#L23-L59","documentation":"Raised by the encoder preprocessing CLI when the webrtcvad package cannot be imported. webrtcvad performs voice activity detection (VAD) used to trim silence/noise from utterances before feature extraction. The check runs unless --no_trim was passed, and the bare except catches any import failure (missing package or broken native build).","triggerScenarios":"Running encoder_preprocess.py without --no_trim on an environment where webrtcvad is not installed or its C extension failed to build/import.","commonSituations":"Fresh environment where requirements.txt wasn't fully installed; webrtcvad wheels unavailable for the Python version/platform (e.g. Python 3.11+ where old webrtcvad has no wheel and gcc is missing); Docker images trimmed of build tools.","solutions":["pip install webrtcvad (or pip install webrtcvad-wheels for newer Python)","Re-run with --no_trim to skip VAD trimming if you can't install it","Install build tools (gcc, python-dev) and retry if compiling from source fails"],"exampleFix":"# before\npython encoder_preprocess.py datasets/SV2TTS/synthesizer\n# after (skip VAD)\npython encoder_preprocess.py datasets/SV2TTS/synthesizer --no_trim","handlingStrategy":"validation","validationCode":"def webrtcvad_available() -> bool:\n    try:\n        import webrtcvad  # noqa: F401\n        return True\n    except ImportError:\n        return False\n\nif not webrtcvad_available():\n    args.no_trim = True  # or abort with instructions","typeGuard":null,"tryCatchPattern":"try:\n    import webrtcvad\nexcept ImportError as e:\n    raise RuntimeError('Install webrtcvad or pass --no_trim') from e","preventionTips":["Pin webrtcvad (or webrtcvad-wheels) in requirements.txt","Fail fast at startup with a dependency check that lists missing packages","Document the --no_trim escape hatch in run scripts"],"tags":["python","dependencies","webrtcvad","preprocessing","audio"],"backgroundTag":"missing-dependency","analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}