0 votes

Well I need to get the length of audio resource (.ogg), I've searched the doc but well.. no luck.. class AudioStreamOGGVorbis, AudioStream dont have length variable. So, how do you get the length of Audio Resource in Godot 3?

asked Jan 17, 2018 in Engine by earlroxas (68 points)
edited Jan 21, 2018 by earlroxas

2 Answers

0 votes

If you have set the AudioStream resource to a StreamPlayer (which I assume you will be doing if it's being used as music), then you can use StreamPlayer.get_length() to get the length of the audio in seconds.

answered Jan 17, 2018 by literalcitrus (494 points)

StreamPlayer? You mean the one with Godot 2.X? Sorry, In this question I use Godot 3 (Let me edit the question). Have you tried Godot 3 yet? If you have, please tell me how to get the Audio Length.

And I checked the Godot 3 doc, the AudioStreamPlayer class in Godot3 dont have get_length method.

0 votes
answered Sep 27, 2019 by uriel (103 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 How to use this Q&A? before posting your first questions.