Skip to content
TheChatArchiveThe Chat Archive
Perplexitysonar· PerplexityHugging Face LMArena Search Arena 24K

放入openai-whisper 的wav有什么严格限制吗?比如采样率

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with gpt-4o-search-preview’s answer.
  1. User

    放入openai-whisper 的wav有什么严格限制吗?比如采样率

  2. Perplexity Assistant

    OpenAI Whisper API对输入音频的采样率和格式存在严格限制:

    核心限制

    1. 采样率要求
      Whisper API要求音频文件的采样率必须为16 kHz。若输入音频未达标,需先进行重采样处理[11][15]。

    2. 支持格式
      支持的音频格式包括:wav、mp3、m4a、mp4、webm等,但不支持压缩格式的音频流(如MP3的VBR模式)[1][14]。


    其他关键限制

    参数限制内容
    文件大小单文件最大25 MB(超过需分割处理)[1][4][7]
    音频时长无明确时长限制,但受文件大小限制约束(约25 MB ≈ 1小时音频)[1][4]
    内容限制禁止包含违法、暴力、成人等内容(需遵守OpenAI内容政策)[1][14]
    语言支持支持98种语言(中文需指定language='Chinese'参数)[5][8][15]

    处理建议

    1. 采样率转换
      使用工具(如ffmpeg或Python库pydub)将音频重采样至16 kHz:

      ffmpeg -i input.wav -ar 16000 output.wav
      
    2. 文件分割
      对超大文件使用pydub分割为25 MB以下的片段:

      from pydub import AudioSegment
      audio = AudioSegment.from_wav("large_file.wav")
      chunks = audio[::25000]  # 按25秒分割
      
    3. 格式兼容性
      若使用wav格式,需确保未压缩且采样率为16 kHz[11][15]。

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.