iPhone SDK:在不同级别平移音频

发布于 2024-08-25 09:47:03 字数 71 浏览 3 评论 0原文

我试图控制播放音频文件的通道(左/右)及其音量。如果有人可以解释如何做到这一点或向我指出一些解释这一点的文档或教程,那就太好了。

I am trying to control the channel (left/right) and its volume from which the audio file is played. It will be great if someone can explain how this can be done or point me to some document or tutorial which explains this.

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

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

发布评论

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

评论(1

私藏温柔 2024-09-01 09:47:03

如果源音频是单声道的,则平移是通过降低左声道或右声道之一的音量来完成的,因此在中心,它们都处于 100%,并且当您向左或右平移时,其中一个声道会逐渐降低。

如果您的源音频是立体声的,则称为“平衡”,其操作方式与平移相同,只不过两个通道保持独立,而不是将一个通道同时放入左右两侧。

可以通过将每个样本乘以一个百分比来控制音量。

但这是在您在样本级别读取和混合音频的情况下。如果您使用的是更高级别的 API 之一,通常会有一个混音器单元或混音器控件,您可以在其中设置值,它会自动完成所有操作。

以下是有关 Core Audio 的更多底层文档:

http://developer.apple.com/Mac/library/documentation/MusicAudio/Conceptual/AudioUnitProgrammingGuide/AQuickTouroftheCoreAudioSDK/AQuickTouroftheCoreAudioSDK.html

If your source audio is monophonic, panning is done by reducing the volume in one of the left or right channels, so at center, they're both at 100%, and one channel is ramped down as you pan left or right.

If your source audio is stereophonic, then it's called "balance" and that's done the same way as panning, except that the two channels are kept separate instead of one channel being put into both left and right.

Volume can be controlled by multiplying each sample by a percentage.

But that's if you're reading and mixing audio at the sample level. If you're using one of the higher-level APIs there's usually a mixer unit or mixer controls where you set values for it and it does all that automatically.

Here's more low-level documentation on Core Audio:

http://developer.apple.com/Mac/library/documentation/MusicAudio/Conceptual/AudioUnitProgrammingGuide/AQuickTouroftheCoreAudioSDK/AQuickTouroftheCoreAudioSDK.html

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