godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.52k stars 21.07k forks source link

WAV file that works everywhere else is silent in Godot #85466

Closed goatchurchprime closed 10 months ago

goatchurchprime commented 11 months ago

Godot version

4.2.rc2,3.5.1

System information

Godot v4.2.rc (fc7920185) - NixOS 23.11 (Tapir) - Wayland - Vulkan (Mobile) - integrated Intel(R) Graphics (ADL GT2) - 12th Gen Intel(R) Core(TM) i5-1240P (16 Threads)

Issue description

This short 1.5second WAV file came from a site with free sounds (None of the other sounds from the same source worked either).

Godot imports this sound file with a duration of 0, so it doesn't play anything. There are no error messages that I can see. I have attempted to re-import it with various different settings, and have tried it with an online inspection tool that didn't throw up any clues. This file plays properly in Audacity and VLC.

This problem is the same for Godot3.5.1, and probably applies to all versions.

Steps to reproduce

Unzip and preview Cloth_02.wav in Godot. It doesn't play.

The second file Cloth_02_savedfromaudacity.wav is what happens if I load and save it from Audacity. Then Godot loads and plays it as it should.

Cloth_02.zip

Minimal reproduction project

N/A

lawnjelly commented 11 months ago

If it's any consolation, my own (non-godot) wav importer can't read it either. :grin:

Something about the chunks seems non-simple, perhaps the block_align. It's got some text chunks before the audio. It's probably figure-outable to make the importer more robust.

Calinou commented 11 months ago

file and FFmpeg information:

$ file Cloth_02.wav
Cloth_02.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 44100 Hz

$ ffprobe Cloth_02.wav
Input #0, wav, from 'Cloth_02.wav':
Metadata:
encoded_by      : ZOOM Handy Recorder H4n
date            : 2012-02-07
creation_time   : 14:34:13
time_reference  : 2313802223
coding_history  : A=PCM,F=44100,W=16,M=stereo,T=ZOOM Handy Recorder H4n
Duration: 00:00:01.50, bitrate: 762 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 1 channels, s16, 705 kb/s
$ file Cloth_02_savedfromaudacity.wav
Cloth_02_savedfromaudacity.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 16000 Hz

$ ffprobe Cloth_02_savedfromaudacity.wav
Input #0, wav, from 'Cloth_02_savedfromaudacity.wav':
Duration: 00:00:01.50, bitrate: 256 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, 1 channels, s16, 256 kb/s