Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slight delay when looping .ogg file #26931

Open
Tracked by #76797
Yomic opened this issue Mar 11, 2019 · 6 comments
Open
Tracked by #76797

Slight delay when looping .ogg file #26931

Yomic opened this issue Mar 11, 2019 · 6 comments

Comments

@Yomic
Copy link

Yomic commented Mar 11, 2019

Godot version:
3.1 RC2 (Also happening on 3.0.6)

OS/device including version:
Windows 8.1 Pro 64-bit and Windows 7 Pro 64-bit

Issue description:
When an ogg file loops, there is a slight delay before looping the sample back to the beginning.

Steps to reproduce:
Create a project with an empty node. Add an AudioStreamPlayer to the node and load an ogg file. Check auto-play and run the project. This is more apparent with music that has a perfect loop from the end to beginning.

Minimal reproduction project:
In the provided project, the ogg sample should automatically play. The ogg sample is 9 seconds long.
OggMusicTest.zip

@Yomic
Copy link
Author

Yomic commented Mar 11, 2019

As a side note, looping a wav file does not have this slight delay, but the file sizes are unacceptable for normal use if you have a lot of music.

@Sslaxx
Copy link

Sslaxx commented Mar 11, 2019

Not noticed this with 3.0.6 or 3.1 using Linux (up to 3.1 beta 7 or thereabouts anyway).

@Chaosus Chaosus added this to the 3.1 milestone Mar 12, 2019
@akien-mga akien-mga modified the milestones: 3.1, 3.2 Mar 12, 2019
@akien-mga akien-mga modified the milestones: 3.2, 4.0 Jan 14, 2020
@tom-jk
Copy link

tom-jk commented Jul 19, 2020

The music in the supplied project file is somewhat misleading because there is a slight delay at the loop point in the music itself. I've modified the project to add a ~2sec cut of the music that loops perfectly (not musically, but as in there's no silence or pop), plus a noise clip (to check for audible skips) and a 120bpm click track (to check the timing isn't drifting). There is an animation sync'd to the click track and there is a deliberate one-second pause to ensure they start together. You can swap in the other ogg files to test them.

26931_edit.zip

I don't observe any delay with looping ogg files in godot 3.2.2.stable on linux mint 18.3, kernel 4.15.0-55-generic.

@Yomic do you still experience this issue?

@taellinglin
Copy link

I think sometimes the header info for ogg files causes a click...try stripping the ogg header files and making sure the encoder isn't adding any silence at the beginning or end...Wav files generally don't have headers, mainly just audio data, and thus can basically be loaded right into memory. For perfect looping you need to do what the person above did with the tempo and buffers lining up. Ticks are important when rendering or playing back audio.

@taellinglin
Copy link

You may also want to look up to see if the audio is looping at a "Zero crossing" of the wav data....

@akien-mga
Copy link
Member

Is this still reproducible in 4.0 RC 3 or later?

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

No branches or pull requests

6 participants