Android / Ok Google / Snapdragon语音激活/ Hexagon DSP

时间:2017-06-30 20:16:00

标签: speech-recognition android-source voice-recognition qualcomm hexagon-dsp

Hexagon DSP处理器允许您的设备在待机状态下https://qualcomm.com/videos/snapdragon-voice-activation激活。 一些Android设备支持此功能,例如Google Pixel对关键词“Ok Google”做出反应。在android的源代码中,我发现代码负责将关键短语加载到DSP处理器中(Hexagon DSP处理器内置于Qualcomm处理器中):

https://android.googlesource.com/platform/hardware/libhardware/+/master/modules/soundtrigger/sound_trigger_hw.c https://android.googlesource.com/platform/system/media/+/master/audio/include/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; /* unique vendor ID. Identifies the engine the
                                              sound model was build for */
    unsigned int                     data_size;   /* size of opaque model data */
    unsigned int                     data_offset; /* offset of opaque data start from head of struct
                                                (e.g sizeof struct sound_trigger_sound_model) */
};

有谁知道如何生成声音模型的二进制数据或在哪里查找有关它的信息?

您可以通过以下链接下载关键短语“Ok Google”的声音模型: https://drive.google.com/open?id=0B9jcQJRmjR0yaDJhOXN2M2ZLYm8。我将它加载到DSP处理器中并且可以正常工作。

有用的Android课程: https://android.googlesource.com/platform/frameworks/base/+/master/services/voiceinteraction/java/com/android/server/soundtrigger/SoundTriggerHelper.java https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/hardware/soundtrigger/SoundTriggerModule.java https://android.googlesource.com/platform/frameworks/base/+/master/core/jni/android_hardware_SoundTrigger.cpp https://android.googlesource.com/platform/frameworks/av/+/master/soundtrigger/SoundTrigger.cpp https://android.googlesource.com/platform/frameworks/av/+/master/soundtrigger/ISoundTrigger.cpp

0 个答案:

没有答案