Coder Social home page Coder Social logo

Comments (9)

pixelriot avatar pixelriot commented on September 26, 2024 1

I've done some testing, and it seems as if wav files with 24 bps don't play properly, while the ones with 16 bps have no problem.
Maybe that helps in finding the bug.
I will continue my research.

from gdscriptaudioimport.

Gianclgar avatar Gianclgar commented on September 26, 2024

Hi, could you try to send/post the file via a third party service? I recommend https://tmp.ninja/ since it has a 10gb limit.

Looks like an error in the parsing, since it expects the wav files to have the same structure. This could help to adapt the parsing to different pre-data chunk sizes, so it will be very helpful

from gdscriptaudioimport.

Dimev avatar Dimev commented on September 26, 2024

Ah right I have mega, l'll share it via there
I do think it has to do with the header. I also tried porting the built-in parser to gdscript but that's really slow

from gdscriptaudioimport.

Dimev avatar Dimev commented on September 26, 2024

It seems to sometimes happen with music downloaded as wav with youtubedl

re-exporting it with audacity fixes the issue

from gdscriptaudioimport.

Gianclgar avatar Gianclgar commented on September 26, 2024

I've done some testing, and it seems as if wav files with 24 bps don't play properly, while the ones with 16 bps have no problem.
Maybe that helps in finding the bug.
I will continue my research.

Makes sense since the bitrate is not handled in the current version, just printed out. See lines 118 and 119. I added a "TODO" in the comments

Also, as mentioned in #7 , the format code "3" , which seems to be for 24bit audio is not handled yet.

from gdscriptaudioimport.

pixelriot avatar pixelriot commented on September 26, 2024

When loading the 24bps wav file directly into a Godot AudioPlayer node everything plays fine, although the stream in GD source code seems to not handle format code "3": https://github.com/godotengine/godot/blob/master/scene/resources/audio_stream_sample.cpp#L368

from gdscriptaudioimport.

Gianclgar avatar Gianclgar commented on September 26, 2024

Yup, I've been checking the Godot ResourceImporter code, and it automatically converts bitrates greater than 16bit to 16bit. See lines 289 and below https://github.com/godotengine/godot/blob/a02620f3a5f3b94c68dfbe18874b34ac1c32374a/editor/import/resource_importer_wav.cpp

The file mentioned in #7 is 32bit and when imported with the built-in resource importer it's converted to 16bit.

I assume they did not cover this since they expected users to always use the built-in resource importer

from gdscriptaudioimport.

Gianclgar avatar Gianclgar commented on September 26, 2024

This might have been fixed by #13 . Awaiting confirmation!

from gdscriptaudioimport.

pixelriot avatar pixelriot commented on September 26, 2024

Works like a charm. Nearly my whole wav-library can be played back now. Thanks a lot.

However, I found some that don't play. Somehow, the data-part of "those4bytes" seems empty.
https://drive.proton.me/urls/FDQ71VN5WC#zIZqoIAFgZ1n

from gdscriptaudioimport.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.