Hexagon DSP处理器允许在待机状态下激活您的设备https://qualcomm.com/videos/snapdragon-voice-activation.一些Android设备支持此功能,例如Google Pixel对关键词"Ok Google"做出反应.在android的源代码中,我找到了负责将关键短语加载到DSP处理器的代码(Hexagon DSP处理器内置于Qualcomm处理器中):
自由软件 :和安全网/system/sound_trigger.h
声音模型描述结构sound_trigger_sound_model传递方法stdev_load_sound_model.声音模型结构:
/*
* Base sound model descriptor. This struct is the header of a larger block passed to
* load_sound_model() and containing the binary data of the sound model.
* Proprietary representation of users in binary data must match information indicated
* by users field
*/
struct sound_trigger_sound_model {
sound_trigger_sound_model_type_t type; /* model type. e.g. SOUND_MODEL_TYPE_KEYPHRASE */
sound_trigger_uuid_t uuid; /* unique sound model ID. */
sound_trigger_uuid_t vendor_uuid; …Run Code Online (Sandbox Code Playgroud) speech-recognition voice-recognition android-source hexagon-dsp qualcomm
我在eclipse中有一个具有以下结构的android项目:
|Project1
|-src
|-res
|Project2
|-src
|-res
Run Code Online (Sandbox Code Playgroud)
Project2链接到Project1的源和资源.(在Eclipse中:属性 - > Java构建路径 - >源 - >链接源).
我尝试在IDEA中导入具有相同结构的项目(项目将一次在Eclipse和IDEA中使用).导入时,我遇到了以下问题:
1.如果我在Project2的依赖项中添加Project1(项目结构 - >依赖项),我在尝试运行Project2时收到错误:
android-apt-compiler:...\AndroidManifest.xml:45:错误:错误:发现Noresource匹配给定名称(''''的值为''drawable/ic_launcher')
android-apt-compiler:...\AndroidManifest.xml:45:错误:错误:找不到与给定名称匹配的资源(在'label'处,值为'@ string/app_name')
...
但是在代码(Project2)中,我可以从Project1引用资源而没有任何错误.
2.然后我尝试将Project2路径设置为Project1的资源目录(项目结构 - > Facet'Android' - > Structure),并收到错误:
android-apt-compiler:...\res\values\dimens.xml:7:错误:已经定义了资源条目activity_vertical_margin.
android-apt-compiler:...\res\values\strings.xml:1412:错误:已经定义了资源条目device_not_found.
...
3.我还尝试将res和src文件夹添加为内容根(项目结构 - >源),并接收通知:
模块Project1不得包含源根"...\Project1\src".根已经属于模块"Project2".
4.我尝试设置与步骤1中相同的参数,另外将Project1设为库(项目结构 - > Facet'Android' - >库模块).我收到Project1的错误:
java:...\Project1\src\com ...\TimeLineFragment.java:276:需要常量表达式java:...\Project1\src\com ...\TimeLineFragment.java:276:需要常量表达式
对于像这样的代码:
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_open_dial_pad:
mDialPadListener.openDialpad();
return true;
case R.id.action_delete_all:
mObserver.onDeleteAllEventsAction();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
Run Code Online (Sandbox Code Playgroud)
我没有更多想法如何在IDEA中导入项目.有没有解决方法如何做到这一点(对于描述的项目结构),所以在Eclipse中一切正常?