如何使用 afconvert 将 wav 转换为 aac caf 而无需重新采样

发布于 2024-08-23 04:51:55 字数 586 浏览 2 评论 0原文

我正在制作一个 Iphone 游戏,我们需要使用声音的压缩格式,并且我们希望能够无缝循环回音频文件中的特定样本(因此有一个介绍,然后循环回偏移量) )

目前我发现允许无缝循环(报告正确的启动和填充帧编号,循环时不点击等)的唯一导出过程是使用苹果的 afconvert 到 caf 文件中的 aac 格式。

但是当我们尝试编码为较低的比特率时,它会自动重新采样声音!我们不想对声音进行重新采样,我遇到的每个其他编码器都有一个设置输出采样率的选项,但我找不到这个编码器。

另一方面,如果有人有幸使用音频队列无缝循环压缩文件格式,请告诉我。

目前我正在处理在以下位置找到的信息:

http://developer .apple.com/mac/library/qa/qa2009/qa1636.html

请注意,当我将编码的比特率保留为默认值(~128kbs)但当我将其设置为 32kbps 时,这确实工作得很好 - 使用-b 选项 - 它重新采样,现在循环点击。

I'm making an Iphone game, we need to use a compressed format for sound, and we want to be able to loop SEAMLESSLY back to a specific sample in the audio file (so there is an intro, then it loops back to an offset)

currently THE ONLY export process I have found that will allow seamless looping (reports the right priming and padding frame numbers, no clicking when looping ect) is using apple's afconvert to a aac format in a caf file.

but when we try and encode to lower bitrates, it automatically re samples the sound! we do NOT want to have the sound re sampled, every other encoder I have encountered has an option to set the output sample rate, but I can't find it for this one.

on another note, if anyone has had any luck with seamless looping of a compressed file format using audio queues, let me know.

currently I'm working off the information found at:

http://developer.apple.com/mac/library/qa/qa2009/qa1636.html

note that this DID work PERFECTLY when I left the bitrate for the encode at default (~128kbs) but when I set it to 32kbps - with the -b option - it resampled, and looping clicks now.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爺獨霸怡葒院 2024-08-30 04:51:55

它至少需要 48kbps。 32kbps 将下采样至较低的采样率。

It needs to be at least 48kbps. 32kbps will downsample to a lower sample rate.

沒落の蓅哖 2024-08-30 04:51:55

我认为您混淆了采样率(典型值:32kHz、44.1kHz、48kHz)和比特率(典型值:128kbps、160kbps、192kbps)。

对于比特率来说,32kbps 是非常低的。在此比特率下声音质量会很差。您可能打算将采样率设置为 32kHz,这也不是完全典型的,但更有意义。

当压缩为 AAC 并解压缩回 WAV 时,您将不会得到相同的音频文件,因为在 AAC 中,音频数据以与原始波形完全不同的格式表示。例如,您可以有几微秒的偏移,这是转换为压缩格式所必需的。使用任何高度压缩的格式都无法完全解决这个问题。

咔嗒声源自直接连续播放的两个样本之间的突然变化。发生这种情况的原因可能是,您在循环中跳回的偏移量最终不会位于 AAC 文件中与 WAV 文件中完全相同的位置(如上所述,可能会有微秒的偏移)。

压缩时您将无法回避这些细微的变化。相反,您必须在压缩后通过调整偏移来补偿它们。这意味着您必须在音频编辑器(例如 Audacity)中打开压缩的声音文件,并手动找到另一个接近原始偏移的偏移量,该偏移量适合循环。

如何找到适合循环的偏移量?

放大到波形的末端。看看那里的波形如何。然后放大原始偏移处的波形,并在其邻域中搜索波形与波形末尾无缝连接的偏移量。

例如,它应该是什么样子,在音频编辑器中打开未压缩的音频文件并检查波形的末尾和那里的偏移量。

I think you are confusing sample rate (typical values: 32kHz, 44.1kHz, 48kHz) and bit rate (typical values: 128kbps, 160kbps, 192kbps).

For a bit rate, 32kbps is extremely low. Sound will have bad quality at this bit rate. You probably intended to set the sample rate to 32kHz instead, which is also not outright typical, but makes more sense.

When compressing to AAC and uncompressing back to WAV, you will not get the same audio file back, because in AAC, the audio data is represented in a completely different format than in raw wave. E.g. you can have shifts by few microseconds, which are necessary to convert to the compressed format. You can not completely get around this with any highly compressed format.

The clicking sound originates from the sudden change between two samples which are played in direct succession. This is likely taking place because the offset to which you jump back in your loop does not end up to be at exactly the same position in the AAC file as it was in the WAV file (as explained above, there can shifts by microseconds).

You will not get around these slight changes when compressing. Instead, you have to compensate for them after compression by adjusting the offset. That means you have to open the compressed sound file in an audio editor, e.g. Audacity, and manually find another offset close to the original one, which is suitable for looping.

How to find an offset which is suitable for looping?

Zoom in to the waveform's end. Look at how the waveform looks there. Then zoom in to the waveform at the original offset and search in its neighbourhood for an offset at which the waveform connects seamlessly to the end of the waveform.

For an example how this shoud look like, open the uncompressed audio file in the audio editor and examine the end of the waveform and the offset there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文