diff --git a/en/application-dev/reference/apis/js-apis-audio.md b/en/application-dev/reference/apis/js-apis-audio.md index 332f8903b50359b0927e6437355a6492fccabb73..43b942d59a35170c7a6d5d31be73f87371f36565 100644 --- a/en/application-dev/reference/apis/js-apis-audio.md +++ b/en/application-dev/reference/apis/js-apis-audio.md @@ -1138,6 +1138,8 @@ setAudioParameter(key: string, value: string, callback: AsyncCallback<void> Sets an audio parameter. This API uses an asynchronous callback to return the result. +This API is used to extend the audio configuration based on the hardware capability. The supported audio parameters vary according to the device and can be obtained from the device manual. The example below is for reference only. + **System capability**: SystemCapability.Multimedia.Audio.Core **Parameters** @@ -1151,7 +1153,7 @@ Sets an audio parameter. This API uses an asynchronous callback to return the re **Example** ``` -audioManager.setAudioParameter('PBits per sample', '8 bit', (err) => { +audioManager.setAudioParameter('key_example', 'value_example', (err) => { if (err) { console.error('Failed to set the audio parameter. ${err.message}'); return; @@ -1166,6 +1168,8 @@ setAudioParameter(key: string, value: string): Promise<void> Sets an audio parameter. This API uses a promise to return the result. +This API is used to extend the audio configuration based on the hardware capability. The supported audio parameters vary according to the device and can be obtained from the device manual. The example below is for reference only. + **System capability**: SystemCapability.Multimedia.Audio.Core **Parameters** @@ -1184,7 +1188,7 @@ Sets an audio parameter. This API uses a promise to return the result. **Example** ``` -audioManager.setAudioParameter('PBits per sample', '8 bit').then(() => { +audioManager.setAudioParameter('key_example', 'value_example').then(() => { console.log('Promise returned to indicate a successful setting of the audio parameter.'); }); ``` @@ -1195,6 +1199,8 @@ getAudioParameter(key: string, callback: AsyncCallback<string>): void Obtains the value of an audio parameter. This API uses an asynchronous callback to return the result. +This API is used to extend the audio configuration based on the hardware capability. The supported audio parameters vary according to the device and can be obtained from the device manual. The example below is for reference only. + **System capability**: SystemCapability.Multimedia.Audio.Core **Parameters** @@ -1207,7 +1213,7 @@ Obtains the value of an audio parameter. This API uses an asynchronous callback **Example** ``` -audioManager.getAudioParameter('PBits per sample', (err, value) => { +audioManager.getAudioParameter('key_example', (err, value) => { if (err) { console.error('Failed to obtain the value of the audio parameter. ${err.message}'); return; @@ -1222,6 +1228,8 @@ getAudioParameter(key: string): Promise<string> Obtains the value of an audio parameter. This API uses a promise to return the result. +This API is used to extend the audio configuration based on the hardware capability. The supported audio parameters vary according to the device and can be obtained from the device manual. The example below is for reference only. + **System capability**: SystemCapability.Multimedia.Audio.Core **Parameters** @@ -1239,7 +1247,7 @@ Obtains the value of an audio parameter. This API uses a promise to return the r **Example** ``` -audioManager.getAudioParameter('PBits per sample').then((value) => { +audioManager.getAudioParameter('key_example').then((value) => { console.log('Promise returned to indicate that the value of the audio parameter is obtained.' + value); }); ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-audio.md b/zh-cn/application-dev/reference/apis/js-apis-audio.md index ba55cc16c3504d18bd8b02ba9b98e5a733f01210..90c813061fb1fa2cc55387f4b73126ad6ef1e716 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-audio.md +++ b/zh-cn/application-dev/reference/apis/js-apis-audio.md @@ -1137,6 +1137,8 @@ setAudioParameter(key: string, value: string, callback: AsyncCallback<void> 音频参数设置,使用callback方式异步返回结果。 +本接口的使用场景为根据硬件设备支持能力扩展音频配置。在不同的设备平台上,所支持的音频参数会存在差异。示例代码内使用样例参数,实际支持的音频配置参数见具体设备平台的资料描述。 + **系统能力:** SystemCapability.Multimedia.Audio.Core **参数:** @@ -1150,7 +1152,7 @@ setAudioParameter(key: string, value: string, callback: AsyncCallback<void> **示例:** ``` -audioManager.setAudioParameter('PBits per sample', '8 bit', (err) => { +audioManager.setAudioParameter('key_example', 'value_example', (err) => { if (err) { console.error('Failed to set the audio parameter. ${err.message}'); return; @@ -1165,6 +1167,8 @@ setAudioParameter(key: string, value: string): Promise<void> 音频参数设置,使用Promise方式异步返回结果。 +本接口的使用场景为根据硬件设备支持能力扩展音频配置。在不同的设备平台上,所支持的音频参数会存在差异。示例代码内使用样例参数,实际支持的音频配置参数见具体设备平台的资料描述。 + **系统能力:** SystemCapability.Multimedia.Audio.Core **参数:** @@ -1183,7 +1187,7 @@ setAudioParameter(key: string, value: string): Promise<void> **示例:** ``` -audioManager.setAudioParameter('PBits per sample', '8 bit').then(() => { +audioManager.setAudioParameter('key_example', 'value_example').then(() => { console.log('Promise returned to indicate a successful setting of the audio parameter.'); }); ``` @@ -1194,6 +1198,8 @@ getAudioParameter(key: string, callback: AsyncCallback<string>): void 获取指定音频参数值,使用callback方式异步返回结果。 +本接口的使用场景为根据硬件设备支持能力扩展音频配置。在不同的设备平台上,所支持的音频参数会存在差异。示例代码内使用样例参数,实际支持的音频配置参数见具体设备平台的资料描述。 + **系统能力:** SystemCapability.Multimedia.Audio.Core **参数:** @@ -1206,7 +1212,7 @@ getAudioParameter(key: string, callback: AsyncCallback<string>): void **示例:** ``` -audioManager.getAudioParameter('PBits per sample', (err, value) => { +audioManager.getAudioParameter('key_example', (err, value) => { if (err) { console.error('Failed to obtain the value of the audio parameter. ${err.message}'); return; @@ -1221,6 +1227,8 @@ getAudioParameter(key: string): Promise<string> 获取指定音频参数值,使用Promise方式异步返回结果。 +本接口的使用场景为根据硬件设备支持能力扩展音频配置。在不同的设备平台上,所支持的音频参数会存在差异。示例代码内使用样例参数,实际支持的音频配置参数见具体设备平台的资料描述。 + **系统能力:** SystemCapability.Multimedia.Audio.Core **参数:** @@ -1238,7 +1246,7 @@ getAudioParameter(key: string): Promise<string> **示例:** ``` -audioManager.getAudioParameter('PBits per sample').then((value) => { +audioManager.getAudioParameter('key_example').then((value) => { console.log('Promise returned to indicate that the value of the audio parameter is obtained.' + value); }); ```