播放不同的声音 [英] PlayBack different voices

查看:92
本文介绍了播放不同的声音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用iPhone应用程序,我需要多种声音,例如成人的声音变成孩子的声音.

I am working on iphone app, I required multiple voices , e.g. Adult voice become children voice.

我如何使用AVFoundation播放声音.

How can i implement it, I am using AVFoundation for playing voice.

请提供一些编码.

推荐答案

要实现所需的功能,您需要音高转换功能.您可以使用OpenAL来实现.

To implement what you need, you need pitch shifting capabilities. You can use OpenAL to achieve this.

具体来说,在OpenAL中,您可以设置音高

Specifically, in OpenAL, to set pitch you do

alSourcef(source, AL_PITCH, 1.2f); 

其中source是OpenAL声音源的ID.

where source is the id of the OpenAL sound source.

如果您不熟悉OpenAL,请从此处开始: http://benbritten.com/2008/11/06/openal-sound-on-the-iphone/

If you are new to OpenAL, get started here: http://benbritten.com/2008/11/06/openal-sound-on-the-iphone/

这篇关于播放不同的声音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆