未验证 提交 274b8cfa 编写于 作者: O openharmony_ci 提交者: Gitee

!21413 修改doc文档中部分代码规范问题

Merge pull request !21413 from zvanxu/master
......@@ -3043,7 +3043,7 @@ isVolumeUnadjustable(): boolean
**示例:**
```js
bool volumeAdjustSwitch = audioVolumeGroupManager.isVolumeUnadjustable();
let volumeAdjustSwitch = audioVolumeGroupManager.isVolumeUnadjustable();
console.info(`Whether it is volume unadjustable: ${volumeAdjustSwitch}.`);
```
......@@ -5757,13 +5757,13 @@ audioRenderer.getCurrentOutputDevices((err, deviceInfo) => {
console.error(`getCurrentOutputDevices Fail: ${err}`);
} else {
console.info(`DeviceInfo id: ${deviceInfo.id}`);
console.info(`DeviceInfo type: ${descriptor.deviceType}`);
console.info(`DeviceInfo role: ${descriptor.deviceRole}`);
console.info(`DeviceInfo name: ${descriptor.name}`);
console.info(`DeviceInfo address: ${descriptor.address}`);
console.info(`DeviceInfo samplerates: ${descriptor.sampleRates[0]}`);
console.info(`DeviceInfo channelcounts: ${descriptor.channelCounts[0]}`);
console.info(`DeviceInfo channelmask: ${descriptor.channelMasks}`);
console.info(`DeviceInfo type: ${deviceInfo.deviceType}`);
console.info(`DeviceInfo role: ${deviceInfo.deviceRole}`);
console.info(`DeviceInfo name: ${deviceInfo.name}`);
console.info(`DeviceInfo address: ${deviceInfo.address}`);
console.info(`DeviceInfo samplerates: ${deviceInfo.sampleRates[0]}`);
console.info(`DeviceInfo channelcounts: ${deviceInfo.channelCounts[0]}`);
console.info(`DeviceInfo channelmask: ${deviceInfo.channelMasks}`);
}
});
```
......@@ -5786,13 +5786,13 @@ getCurrentOutputDevices(): Promise<AudioDeviceDescriptors>
```js
audioRenderer.getCurrentOutputDevices().then((deviceInfo) => {
console.info(`DeviceInfo id: ${deviceInfo.id}`);
console.info(`DeviceInfo type: ${descriptor.deviceType}`);
console.info(`DeviceInfo role: ${descriptor.deviceRole}`);
console.info(`DeviceInfo name: ${descriptor.name}`);
console.info(`DeviceInfo address: ${descriptor.address}`);
console.info(`DeviceInfo samplerates: ${descriptor.sampleRates[0]}`);
console.info(`DeviceInfo channelcounts: ${descriptor.channelCounts[0]}`);
console.info(`DeviceInfo channelmask: ${descriptor.channelMasks}`);
console.info(`DeviceInfo type: ${deviceInfo.deviceType}`);
console.info(`DeviceInfo role: ${deviceInfo.deviceRole}`);
console.info(`DeviceInfo name: ${deviceInfo.name}`);
console.info(`DeviceInfo address: ${deviceInfo.address}`);
console.info(`DeviceInfo samplerates: ${deviceInfo.sampleRates[0]}`);
console.info(`DeviceInfo channelcounts: ${deviceInfo.channelCounts[0]}`);
console.info(`DeviceInfo channelmask: ${deviceInfo.channelMasks}`);
}).catch((err) => {
console.error(`Get current output devices Fail: ${err}`);
});
......@@ -6040,7 +6040,7 @@ on(type: 'outputDeviceChange', callback: Callback\<AudioDeviceDescriptors>): voi
**示例:**
```js
audioRenderer.on('outputDeviceChange', (deviceChangeInfo) => {
audioRenderer.on('outputDeviceChange', (err, deviceChangeInfo) => {
if (err) {
console.error(`Subscribes output device change event callback Fail: ${err}`);
} else {
......@@ -6072,7 +6072,7 @@ off(type: 'outputDeviceChange', callback?: Callback\<AudioDeviceDescriptors>): v
**示例:**
```js
audioRenderer.off('outputDeviceChange', (deviceChangeInfo) => {
audioRenderer.off('outputDeviceChange', (err,deviceChangeInfo) => {
if (err) {
console.error(`Unsubscribes output device change event callback Fail: ${err}`);
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册