{"record":{"id":"7bfe4b70ad265f3e","repo":"babysor/MockingBird","slug":"package-webrtcvad-not-found-this-package-enable-7bfe4b","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/vocoder_preprocess.py","lineNumber":53,"sourceCode":"    args = parser.parse_args()\n    print_args(args, parser)\n    modified_hp = hparams.parse(args.hparams)\n    \n    if not hasattr(args, \"in_dir\"):\n        args.in_dir = os.path.join(args.datasets_root, \"SV2TTS\", \"synthesizer\")\n    if not hasattr(args, \"out_dir\"):\n        args.out_dir = os.path.join(args.datasets_root, \"SV2TTS\", \"vocoder\")\n\n    if args.cpu:\n        # Hide GPUs from Pytorch to force CPU processing\n        os.environ[\"CUDA_VISIBLE_DEVICES\"] = \"\"\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    run_synthesis(args.in_dir, args.out_dir, args.model_dir, modified_hp)\n\n","sourceCodeStart":35,"sourceCodeEnd":60,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/control/cli/vocoder_preprocess.py#L35-L60","documentation":"Raised by the vocoder preprocessing CLI when the webrtcvad package cannot be imported. VAD trimming is optional; the check is skipped when --no_trim is passed. Any import error (missing package or broken native extension) triggers this ModuleNotFoundError.","triggerScenarios":"Running vocoder_preprocess.py without --no_trim in an environment lacking a working webrtcvad install.","commonSituations":"Partial requirements installation; webrtcvad source build failing on systems without gcc/python headers; CI images without build toolchain.","solutions":["pip install webrtcvad","Run with --no_trim to disable VAD trimming","Use pip install webrtcvad-wheels as a drop-in on unsupported Python versions"],"exampleFix":"# before\npython vocoder_preprocess.py datasets/SV2TTS/synthesizer\n# after\npython vocoder_preprocess.py datasets/SV2TTS/synthesizer --no_trim","handlingStrategy":"validation","validationCode":"try:\n    import webrtcvad  # noqa: F401\n    HAS_VAD = True\nexcept ImportError:\n    HAS_VAD = False\n\nif not HAS_VAD and not args.no_trim:\n    raise SystemExit('webrtcvad missing; pass --no_trim or pip install webrtcvad')","typeGuard":null,"tryCatchPattern":"try:\n    import webrtcvad\nexcept ImportError as e:\n    raise RuntimeError('Install webrtcvad or pass --no_trim') from e","preventionTips":["Include webrtcvad in the environment bootstrap script","Cache the availability check once instead of importing repeatedly","Test preprocessing in CI with and without webrtcvad installed"],"tags":["python","dependencies","webrtcvad","vocoder","audio"],"backgroundTag":"missing-dependency","analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}