Commit 605d12b7 authored by rlp's avatar rlp Committed by Commit bot

[Hotword] Adding audio parameters to handle audio coming from the DSP.

BUG=403138

Review URL: https://codereview.chromium.org/551823005

Cr-Commit-Position: refs/heads/master@{#308487}
parent 215d44f2
...@@ -53,6 +53,7 @@ class MEDIA_EXPORT AudioParameters { ...@@ -53,6 +53,7 @@ class MEDIA_EXPORT AudioParameters {
ECHO_CANCELLER = 0x1, ECHO_CANCELLER = 0x1,
DUCKING = 0x2, // Enables ducking if the OS supports it. DUCKING = 0x2, // Enables ducking if the OS supports it.
KEYBOARD_MIC = 0x4, KEYBOARD_MIC = 0x4,
HOTWORD = 0x8,
}; };
AudioParameters(); AudioParameters();
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "media/audio/cras/cras_input.h" #include "media/audio/cras/cras_input.h"
#include <cras_input.h>
#include <math.h> #include <math.h>
#include "base/basictypes.h" #include "base/basictypes.h"
...@@ -159,6 +160,10 @@ void CrasInputStream::Start(AudioInputCallback* callback) { ...@@ -159,6 +160,10 @@ void CrasInputStream::Start(AudioInputCallback* callback) {
return; return;
} }
uint32_t flags = 0;
if (params_.effects() & AudioParameters::PlatformEffectsMask::HOTWORD)
flags = HOTWORD_STREAM;
unsigned int frames_per_packet = params_.frames_per_buffer(); unsigned int frames_per_packet = params_.frames_per_buffer();
cras_stream_params* stream_params = cras_client_stream_params_create( cras_stream_params* stream_params = cras_client_stream_params_create(
stream_direction_, stream_direction_,
...@@ -166,7 +171,7 @@ void CrasInputStream::Start(AudioInputCallback* callback) { ...@@ -166,7 +171,7 @@ void CrasInputStream::Start(AudioInputCallback* callback) {
frames_per_packet, // Call back when this many ready. frames_per_packet, // Call back when this many ready.
frames_per_packet, // Minimum Callback level ignored for capture streams. frames_per_packet, // Minimum Callback level ignored for capture streams.
CRAS_STREAM_TYPE_DEFAULT, CRAS_STREAM_TYPE_DEFAULT,
0, // Unused flags. flags,
this, this,
CrasInputStream::SamplesReady, CrasInputStream::SamplesReady,
CrasInputStream::StreamError, CrasInputStream::StreamError,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment