weilikai
2025-09-20 eb1574b813e230b156fc09eaaf03227b1b0b4134
funasr/utils/load_utils.py
@@ -241,10 +241,19 @@
    # This launches a subprocess to decode audio while down-mixing
    # and resampling as necessary.  Requires the ffmpeg CLI in PATH.
    # fmt: off
    pcm_params = []
    if file.lower().endswith('.pcm'):
        pcm_params = [
            "-f", "s16le",
            "-ar", str(sr),
            "-ac", "1"
        ]
    cmd = [
        "ffmpeg",
        "-nostdin",
        "-threads", "0",
        *pcm_params,  # PCM files need input format specified before -i since PCM is raw data without headers
        "-i", file,
        "-f", "s16le",
        "-ac", "1",