支持OpenSL ES功能在Android中 [英] Supported OpenSL ES Features in Android

查看:622
本文介绍了支持OpenSL ES功能在Android中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android的应该是通过OpenSL ES API,它是通过NDK入店,支持3D音效。这或多或少的作品,我设法它通过创建播放器和一个输出组合,以播放声音。但是,当我试图实现与三维位置接口(SL_IID_3DLOCATION常数)的监听器这是强制性的玩3D音效。但是,当我尝试设置常数SL_BOOLEAN_TRUE的CreateListener方法的结果是12传递到LogCat中。图12是OpenSL ES恒定SL_RESULT_FEATURE_UNSUPPORTED的值。下面你可以找到的code很短的一部分,任何人都可以确认,如果我做错什么,或者如果功能真的是unsopported,这意味着OpenSL ES实现不支持3D音效?

 的#define SL_RESULT_FEATURE_UNSUPPORTED((SLuint32)0x0000000C)

常量SLInterfaceID listener_ids [] = {SL_IID_3DLOCATION};
常量SLboolean listener_req [] = {SL_BOOLEAN_TRUE};

结果=(*发动机) - > CreateListener(发动机,&安培; listenerObject,1,listener_ids,listener_req);
__android_log_print(ANDROID_LOG_VERBOSE,DEBUG_TAG,CREATE:[%I],结果);

断言(SL_RESULT_SUCCESS ==结果);




结果=(* listenerObject) - >实现(listenerObject,SL_BOOLEAN_FALSE);
__android_log_print(ANDROID_LOG_VERBOSE,DEBUG_TAG,认识到:[%I],结果);

断言(SL_RESULT_SUCCESS ==结果);
 

解决方案

您可能想看看这个网站:的 http://mobilepearls.com/labs/native-android-api/ndk/docs/opensles/ 。它显示的是和(更重要的),不支持的OpenSL ES API的Andr​​oid的东西。我从前没有接触过的3D定位功能,但话又说回来,我还没有需要它。

不管怎样,也许该网站会给你更多的相关信息......

Android is supposed to support 3D audio via the OpenSL es API which is accesible via the NDK. That more or less works, I managed it to play sound via a created player and an output mix. But when I try to realise a listener with a 3D location interface (SL_IID_3DLOCATION constant) which is mandatory for playing 3D sound. But when I try to set the constant to SL_BOOLEAN_TRUE the result of the CreateListener method is 12 as passed to the LogCat. 12 is the value of the OpenSL es constant SL_RESULT_FEATURE_UNSUPPORTED. Below you can find a short part of the code, can anyone confirm if I do anything wrong or if the feature really is unsopported, meaning that the OpenSL es implementation does not support 3D audio?

#define SL_RESULT_FEATURE_UNSUPPORTED       ((SLuint32) 0x0000000C)

const SLInterfaceID listener_ids[] = {SL_IID_3DLOCATION};
const SLboolean listener_req[] = {SL_BOOLEAN_TRUE};

result = (*engine)->CreateListener(engine, &listenerObject, 1, listener_ids, listener_req);
__android_log_print(ANDROID_LOG_VERBOSE, DEBUG_TAG, "CREATE: [%i]", result);

assert(SL_RESULT_SUCCESS == result);




result = (*listenerObject)->Realize(listenerObject, SL_BOOLEAN_FALSE);
__android_log_print(ANDROID_LOG_VERBOSE, DEBUG_TAG, "REALIZE: [%i]", result);

assert(SL_RESULT_SUCCESS == result);

解决方案

You might want to take a look at this website: http://mobilepearls.com/labs/native-android-api/ndk/docs/opensles/. It shows what is and (more importantly), what is not supported by the OpenSL ES API's for Android. I haven't worked with with the 3D location feature, but then again, I haven't had the need for it yet.

Anyway, maybe that site will give you more information about it...

这篇关于支持OpenSL ES功能在Android中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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