pencil2d / pencil

Pencil2D is an easy, intuitive tool to make 2D hand-drawn animations. Pencil2D is open source and cross-platform.
http://pencil2d.org
GNU General Public License v2.0
1.47k stars 273 forks source link

Extra audio formats playback sounds chopped off. WAV & MP3 work perfectly. #1561

Closed Jose-Moreno closed 2 years ago

Jose-Moreno commented 3 years ago

Issue Summary

Under Windows (so far, and probably only on ๐Ÿ™„ ) playing back extra audio formats like AIFF or OGG on a loop and under normal playback will have the audio sound chopped sometimes down to 1/3 of it's original length.

I noticed other AIFF and OGG files do work well, so it's possible these ones have some kind of special metadata or encoding that's getting in the way of Qt's media engine but I didn't check that far, and the only real difference seems to be their total length (healthy samples are lengthier) ๐Ÿค”

Video or Image Reference

https://streamable.com/3s2w6u

Sample Files

Wilhem Scream + PCLX extra_formats_playback_sound_issue_samples.zip

Healthy AIFF & OGG Files (that do work under Windows) for comparison Healthy_Playback_Samples.zip

Expected Results

Considering Pencil2D is converting sounds to WAV internally, I'd expect that the sounds should at least work the same regardless of their initial format, unless of course their quality has been degraded beyond the original, however this doesn't seem to be the case for the sample files.

Steps to reproduce

  1. Load conventionally supported Pencil2D sound formats (WAV, MP3) as reference from the extra formats playback issue samples.
  2. Load extra sound formats (AIFF or OGG) into the Pencil2D timeline at your convenience
  3. Test how extra formats get cut as opposed to conventional formats.

System Information

Development Build Dec 27 2020

Operating System: Windows 10 Version 1909 CPU Architecture: x86_64 Qt Version: 5.14.1

Commit: 414c0a2

scribblemaniac commented 3 years ago

Are the clips getting cut off when exported?

Jose-Moreno commented 3 years ago

@scribblemaniac Just tested now. Fortunately seems that on export the sample sounds work fine ๐Ÿ™‚

chchwy commented 3 years ago

Looking into this.

chchwy commented 3 years ago

I can't figure out why there is a difference between playing AIFF/OGG and WAV. In Pencil2D, they are played in exactly the same way. Something is not quite right in the QMediaPlayer implementation,

Jose-Moreno commented 3 years ago

@chchwy Yeah, it's honestly very odd. Along with @scribblemaniac we tested a lot but came emptyhanded.

I can only propose the conjecture that perhaps it has to do with how the original files were encoded, and how specific audio properties from the original codecs are transferred once Pencil2D converts it to WAV internally (which is why we're also confused). I base this idea off the actual "healthy files" I sent which include another AIFF and OGG of a different sound but which surprisingly do not have the same problem.

I can take a look later at the sounds files again to see if there's any potential information that can be useful to identify and let users know how deal with these odd files before they even are used by Pencil2D. Thanks again for looking into this.