Why certain .wav files cannot be decoded in Firefox

前端 未结 3 1803
自闭症患者
自闭症患者 2021-01-13 04:18

I have a web page which decodes wave files for certain reasons. Chrome and Safari seem to work fine. Firefox occasionally is unable to decode the file and gives the error:

3条回答
  •  星月不相逢
    2021-01-13 04:50

    It might be the JUNK chunk at the start of the file. You can run it through sox to clean out extraneous chunks like this:

    sox Malice_Bass.wav Malice_Bass_simple.wav
    

    Here's what my personal parser says about the file:

    RIFF - WAVE (36467192 bytes)
       JUNK (92)
       bext (602)
             Description:       
             Originator:        Pro Tools
             Originator Ref:    jicj!dad1ofaaaGk
             Origination Date:  2014-09-09
             Origination Time:  20:46:43
             Time Ref Low:      0
             Time Ref High:     0
             BWF Version:       0
             SMPTE UMID Bytes:  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
             Coding History:    
       fmt (40)
             Format Tag:        1
             Channels:          2
             Samples per sec:   48000
             Avg bytes per sec: 192000
             Block align:       4
             Bits per sample:   16
       minf (16)
       elm1 (214)
       data (36466048)
       regn (92)
       umid (24)
    

    When I clean it up using sox Firefox quits complaining about it but still doesn't play it. I confirmed that it loads the file but doesn't seem to play it.

提交回复
热议问题