ThinkSound icon indicating copy to clipboard operation
ThinkSound copied to clipboard

请问为何生成的音频比视频少一秒

Open shanhao opened this issue 1 year ago • 2 comments

shanhao avatar Jul 10 '25 08:07 shanhao

Hi, The reason why the generated audio appears to be about one second shorter than the video is related to how our VAE reconstructs the audio. Specifically, our VAE requires the output audio length to be an integer multiple of 2048 samples. This rounding may cause the audio duration to be slightly shorter than the original, but the maximum possible difference will not exceed 0.047 seconds (2048 / 44100, assuming a 44.1kHz sample rate). However, when checking audio files in some file browsers or players, durations like 9.9 seconds may be displayed as 9 seconds due to rounding in the UI, which can make the difference look larger than it actually is.

liuhuadai avatar Jul 10 '25 09:07 liuhuadai

您好, 生成的音频看起来比视频短约一秒的原因与我们的 VAE 重建音频的方式有关。具体来说,我们的 VAE 要求输出音频长度为 2048 个样本的整数倍。这种舍入可能会导致音频时长略短于原始时长,但最大可能差异不会超过 0.047 秒(2048 / 44100,假设采样率为 44.1kHz)。 但是,在某些文件浏览器或播放器中查看音频文件时,由于用户界面的舍入,9.9 秒之类的时长可能会显示为 9 秒,这会使差异看起来比实际更大。

感谢答疑,这个问题导致我需要在合成视频时最后一帧补上静音,使得某些视频有种戛然而止的感觉

shanhao avatar Jul 11 '25 01:07 shanhao