Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

为音频播放器增加听众位置效果

From Wiki
Jump to: navigation, search
Article Metadata

代码示例
测试基于
设备:: Nokia N95

兼容于
平台: S60 3rd Edition, MR

文章
关键词: CListenerLocation
翻译:
hoolee
最后由 hamishwillee 在 14 Jun 2013 编辑
  • 开发伙伴平台: S60 3rd Edition, MR
  • 详细描述

S60平台有多个音频增强API,可以用来修改声音体验。其中一个就叫CListenerLocation API,这个API可以使听者对音频源的位置发生变化。

代码片段自签名即可执行。


前言

音频播放器必须要在构造API实例前创建,我们可以通过下列代码来实现:

iMdaAudioPlayerUtility =
CMdaAudioPlayerUtility::NewFilePlayerL(aFileName,
*this,
EMdaPriorityNormal,
EMdaPriorityPreferenceTimeAndQuality);


MMP文件

需要下列能力和链接库

CAPABILITY NONE 
LIBRARY ListenerLocationEffect.lib
HEADER ListenerLocationBase.h



源文件

首先您需要构造混音应用实例:

iListener = CListenerLocation::NewL( *iMdaAudioPlayerUtility );


要设置听众位置效果,你需要设置听者的xyz坐标,然后运用效果到播放器上:

iListener->SetLocationCartesianL( iPositionX, iPositionY, iPositionZ );
 
if(!iListener->IsEnabled())
iListener->EnableL();
 
iListener->ApplyL();


你也可以通过定时改变坐标来实现3D音效。


要关闭听众位置效果,可以执行如下代码:

iListener->DisableL()


测试示例

File:3D AudioEfects.zip

This page was last modified on 14 June 2013, at 04:52.
74 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×