0 votes

This Solution worked quite well for me. But only with .ogg files. The same solution with .wav created only a louad rustle. So i dont know why it does not work for .wav files?

Godot version 3.3
in Engine by (12 points)

I've tried and I got the same result as you. The .wav file loaded at runtime makes a lot of noise it's horrible. I've compared the first few bytes to the same song, but loaded to AudioStremPlayer through the editor and they are not the same. Note that it works fine when loaded in the editor.

While searching for more I stumble upon this post https://godotengine.org/qa/67796/problems-when-importing-audio-files-in-runtime.

The guy created an issue describing the problem, and provided a gdscript to parse the wav header. It doesn't work in my case, because the format code parsed was 3 which corresponds to nothing.

But you can try it for yourself.

Here's the issue: https://github.com/godotengine/godot-proposals/issues/732

And the script: https://github.com/Gianclgar/GDScriptAudioImport/blob/master/GDScriptAudioImport.gd

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.