From a6f62a4336a5492b3dacc7eb91033c895be2a51c Mon Sep 17 00:00:00 2001 From: magekkkk Date: Thu, 23 Jun 2022 15:48:11 +0800 Subject: [PATCH 1/3] add voice assistant usage and source Signed-off-by: magekkkk --- api/@ohos.multimedia.audio.d.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index 0704102f7a..0f64434106 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -540,7 +540,13 @@ declare namespace audio { * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core */ - STREAM_USAGE_NOTIFICATION_RINGTONE = 6 + STREAM_USAGE_NOTIFICATION_RINGTONE = 6, + /** + * Voice assistant broadcast usage. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Core + */ + STREAM_USAGE_VOICE_ASSISTANT = 16 } /** @@ -1612,6 +1618,12 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Core */ SOURCE_TYPE_MIC = 0, + /** + * Voice recognition source type. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Core + */ + SOURCE_TYPE_VOICE_RECOGNITION = 6, /** * Voice communication source type. * @since 8 -- Gitee From 811c4edc4df2d09fcaafd34b1124ec28a582c359 Mon Sep 17 00:00:00 2001 From: magekkkk Date: Sat, 25 Jun 2022 14:09:37 +0800 Subject: [PATCH 2/3] add streamid api in renderer and capturer Signed-off-by: magekkkk --- api/@ohos.multimedia.audio.d.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index 0f64434106..e2a7088498 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -1405,6 +1405,20 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ getStreamInfo(): Promise; + /** + * Obtains the renderer stream id. This method uses an asynchronous callback to return the result. + * @param callback Callback used to return the stream id. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Renderer + */ + getAudioStreamId(callback: AsyncCallback): void; + /** + * Obtains the renderer stream id. This method uses a promise to return the result. + * @return Promise used to return the stream id. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Renderer + */ + getAudioStreamId(): Promise; /** * Starts the renderer. This method uses an asynchronous callback to return the result. * @param callback Callback used to return the result. @@ -1716,6 +1730,21 @@ declare namespace audio { */ getStreamInfo(): Promise; + /** + * Obtains the capturer stream id. This method uses an asynchronous callback to return the result. + * @param callback Callback used to return the stream id. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Renderer + */ + getAudioStreamId(callback: AsyncCallback): void; + /** + * Obtains the capturer stream id. This method uses a promise to return the result. + * @return Promise used to return the stream id. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Renderer + */ + getAudioStreamId(): Promise; + /** * Starts capturing. This method uses an asynchronous callback to return the result. * @param callback Callback used to return the result. -- Gitee From 82c6ce74c319decb5fd97a5a2c982c0315065f59 Mon Sep 17 00:00:00 2001 From: magekkkk Date: Sat, 25 Jun 2022 15:38:09 +0800 Subject: [PATCH 3/3] change value for new enum Signed-off-by: magekkkk --- api/@ohos.multimedia.audio.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index e2a7088498..6a134226d4 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -536,17 +536,17 @@ declare namespace audio { */ STREAM_USAGE_VOICE_COMMUNICATION = 2, /** - * Notification or ringtone usage. - * @since 7 + * Voice assistant broadcast usage. + * @since 9 * @syscap SystemCapability.Multimedia.Audio.Core */ - STREAM_USAGE_NOTIFICATION_RINGTONE = 6, + STREAM_USAGE_VOICE_ASSISTANT = 3, /** - * Voice assistant broadcast usage. - * @since 9 + * Notification or ringtone usage. + * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core */ - STREAM_USAGE_VOICE_ASSISTANT = 16 + STREAM_USAGE_NOTIFICATION_RINGTONE = 6 } /** @@ -1637,7 +1637,7 @@ declare namespace audio { * @since 9 * @syscap SystemCapability.Multimedia.Audio.Core */ - SOURCE_TYPE_VOICE_RECOGNITION = 6, + SOURCE_TYPE_VOICE_RECOGNITION = 1, /** * Voice communication source type. * @since 8 -- Gitee