summaryrefslogtreecommitdiffstats
path: root/media/java
diff options
context:
space:
mode:
Diffstat (limited to 'media/java')
-rw-r--r--media/java/android/media/AudioManager.java10
-rw-r--r--media/java/android/media/AudioSystem.java7
2 files changed, 17 insertions, 0 deletions
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index ee17bd3..035b282 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -1526,6 +1526,16 @@ public class AudioManager {
/**
* @hide
+ * Checks whether speech recognition is active
+ * @return true if a recording with source {@link MediaRecorder.AudioSource#VOICE_RECOGNITION}
+ * is underway.
+ */
+ public boolean isSpeechRecognitionActive() {
+ return AudioSystem.isSourceActive(MediaRecorder.AudioSource.VOICE_RECOGNITION);
+ }
+
+ /**
+ * @hide
* If the stream is active locally or remotely, adjust its volume according to the enforced
* priority rules.
* Note: only AudioManager.STREAM_MUSIC is supported at the moment
diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java
index 103e817..260ddc7 100644
--- a/media/java/android/media/AudioSystem.java
+++ b/media/java/android/media/AudioSystem.java
@@ -111,6 +111,13 @@ public class AudioSystem
public static native boolean isStreamActive(int stream, int inPastMs);
/*
+ * Checks whether the specified audio source is active.
+ *
+ * return true if any recorder using this source is currently recording
+ */
+ public static native boolean isSourceActive(int source);
+
+ /*
* Sets a group generic audio configuration parameters. The use of these parameters
* are platform dependent, see libaudio
*