Skip to content

Update script to work with Godot 4#20

Open
Stoxis wants to merge 1 commit intoGianclgar:masterfrom
Stoxis:master
Open

Update script to work with Godot 4#20
Stoxis wants to merge 1 commit intoGianclgar:masterfrom
Stoxis:master

Conversation

@Stoxis
Copy link
Copy Markdown

@Stoxis Stoxis commented Jun 8, 2023

Updated to work with Godot 4

Updated to work with Godot 4
@EeveeEuphoria
Copy link
Copy Markdown

Tested this myself and it seems to work just fine on Godot 4.1.1, thanks for this! Hope this gets merged.

@MonteCrysto31
Copy link
Copy Markdown

So I just found the pull request after fixing it myself for Godot 4 ^^'

I just tried your fix but I saw that support for Ogg Vorbis file had been commented out, here's how I changed that section to work:

elif filepath.ends_with(".ogg"):
	var newstream = AudioStreamOggVorbis.load_from_buffer(bytes)
	newstream.loop = true #set to false or delete this line if you don't want to loop
	return newstream

The data property is not accessible, but you can create an AudioStreamOggVorbis directly with the load_from_buffer method. I tested this and it works as of Godot 4.2.1

@dsyze
Copy link
Copy Markdown

dsyze commented Aug 2, 2024

Thanks a lot! It works very well with wav files on Godot4.2!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants