+1 vote

Hello! This may be a very advanced question to ask but recently I was able to find this interesting tutorial: http://www.rpgmakercentral.com/topic/3825-make-looping-bgm-part-1-ogg-vorbis/

It explains how to set loop points in Audacity and set the Starting Loop and the End loop in the Metadata when exporting to an audio file such as the OGG file format.

The idea is that I want to be able to set up a music stream loop point so then it repeats seamlessly forever or when stopped by command and I couldn't find anything about getting Metadata information from the Godot Documentation other than the Object Metadata. I did notice however that when loading the OGG from resource there is a scripting command called PoolByteArray that can read files, but in RAW format.

So with that in mind, could PoolByteArray be used to fetch Metadata from OGG files or is there a better way to implement the loop point number from the OGG file metadata?

P.S: This may be extra but from learning about the audio loop tutorial above I realize that there is an algorithm to convert the samples into seconds by for set _ loop _ offset():

(Sample / Analog Audio[Hz]) * .001

If the sample was exported in the metadata and loaded in Godot through GDScript it would divide the Analog Audio[Hz] (such as 44.1 for example) and multiply it by .001 to get the number of seconds in float to set the loop point. :)

in Engine by (208 points)

1 Answer

0 votes

PoolByteArray is not a command, it's just an array of bytes.
Setting up loop points is done in Godot AFAIK: http://docs.godotengine.org/en/latest/learning/features/audio/audio_streams.html#audiostream
I'm not aware of ways to do it from within the imported file, thought it would be a nice addition to be proposed on Github.
I think it was not done yet because supported audio formats don't have a standard way of defining loop points (and they dont necessarily contain this info).

by (29,120 points)
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 Frequently asked questions and 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 [email protected] with your username.