From 72b9c119b88bfd82cacb1fcd2ade8ca221e43ce7 Mon Sep 17 00:00:00 2001 From: Qin Peng Date: Fri, 9 Jun 2023 15:25:20 +0800 Subject: [PATCH] =?UTF-8?q?=E2=80=9Cupdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Qin Peng --- .../media/audio-effect-management.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zh-cn/application-dev/media/audio-effect-management.md b/zh-cn/application-dev/media/audio-effect-management.md index 9b9e76d935..0557a69155 100644 --- a/zh-cn/application-dev/media/audio-effect-management.md +++ b/zh-cn/application-dev/media/audio-effect-management.md @@ -12,13 +12,13 @@ 1. 步骤一:导入音频接口。 - ```ts + ```js import audio from '@ohos.multimedia.audio'; ``` 2. 步骤二:配置音频渲染参数并创建AudioRenderer实例,音频渲染参数的详细信息可以查看[AudioRendererOptions](../reference/apis/js-apis-audio.md#audiorendereroptions8),创建AudioRenderer实例时会默认挂载EFFECT_DEFAULT模式音效。 - ```ts + ```js let audioStreamInfo = { samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100, channels: audio.AudioChannel.CHANNEL_1, @@ -50,7 +50,7 @@ ### 查询当前播放实例的音效模式 - ```ts + ```js audioRenderer.getAudioEffectMode((err, effectmode) => { if (err) { console.error(`Failed to get params, code is ${err.code}, message is ${err.message}`); @@ -65,7 +65,7 @@ 关闭系统音效: - ```ts + ```js audioRenderer.setAudioEffectMode(audio.AudioEffectMode.EFFECT_NONE, (err) => { if (err) { console.error(`Failed to set params, code is ${err.code}, message is ${err.message}`); @@ -78,7 +78,7 @@ 开启系统音效默认模式: - ```ts + ```js audioRenderer.setAudioEffectMode(audio.AudioEffectMode.EFFECT_DEFAULT, (err) => { if (err) { console.error(`Failed to set params, code is ${err.code}, message is ${err.message}`); @@ -98,7 +98,7 @@ 1.创建AudioStreamManager实例。在使用AudioStreamManager的API前,需要使用getStreamManager()创建一个AudioStreamManager实例。 - ```ts + ```js import audio from '@ohos.multimedia.audio'; let audioManager = audio.getAudioManager(); let audioStreamManager = audioManager.getStreamManager(); @@ -106,7 +106,7 @@ ### 查询对应场景的音效模式 - ```ts + ```js audioStreamManager.getAudioEffectInfoArray(audio.ContentType.CONTENT_TYPE_MUSIC, audio.StreamUsage.STREAM_USAGE_MEDIA, async (err, audioEffectInfoArray) => { if (err) { console.error(`Failed to get effect info array`); -- GitLab