提交 4e802245 编写于 作者: G Gloria

Update docs against 14261

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 e7ea18b3
......@@ -690,21 +690,19 @@ Describes the interruption event received by the application when playback is in
| forceType | [InterruptForceType](#interruptforcetype9) | Yes | Whether the interruption is taken by the system or to be taken by the application.|
| hintType | [InterruptHint](#interrupthint) | Yes | Hint provided along the interruption. |
## VolumeEvent<sup>8+</sup>
## VolumeEvent<sup>9+</sup>
Describes the event received by the application when the volume is changed.
**System API**: This is a system API.
**System capability**: SystemCapability.Multimedia.Audio.Volume
| Name | Type | Mandatory | Description |
| ---------- | ----------------------------------- | ---- | -------------------------------------------------------- |
| volumeType | [AudioVolumeType](#audiovolumetype) | Yes | Audio stream type. |
| volume | number | Yes | Volume to set. The value range can be obtained by calling **getMinVolume** and **getMaxVolume**.|
| volume | number | Yes | Volume to set. The value range can be obtained by calling **getMinVolume** and **getMaxVolume**. |
| updateUi | boolean | Yes | Whether to show the volume change in UI. |
| volumeGroupId<sup>9+</sup> | number | Yes | Volume group ID. It can be used as an input parameter of **getGroupManager**. |
| networkId<sup>9+</sup> | string | Yes | Network ID. |
| volumeGroupId | number | Yes | Volume group ID. It can be used as an input parameter of **getGroupManager**.<br>This is a system API. |
| networkId | string | Yes | Network ID.<br>This is a system API. |
## MicStateChangeEvent<sup>9+</sup>
......@@ -1112,7 +1110,7 @@ Sets the volume for a stream. This API uses an asynchronous callback to return t
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setVolume](#setvolume9) in **AudioVolumeGroupManager**.
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setVolume](#setvolume9) in **AudioVolumeGroupManager**. The substitute API is available only for system applications.
**Required permissions**: ohos.permission.ACCESS_NOTIFICATION_POLICY
......@@ -1148,7 +1146,7 @@ Sets the volume for a stream. This API uses a promise to return the result.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setVolume](#setvolume9) in **AudioVolumeGroupManager**.
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setVolume](#setvolume9) in **AudioVolumeGroupManager**. The substitute API is available only for system applications.
**Required permissions**: ohos.permission.ACCESS_NOTIFICATION_POLICY
......@@ -1374,7 +1372,7 @@ Mutes or unmutes a stream. This API uses an asynchronous callback to return the
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [mute](#mute9) in **AudioVolumeGroupManager**.
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [mute](#mute9) in **AudioVolumeGroupManager**. The substitute API is available only for system applications.
**System capability**: SystemCapability.Multimedia.Audio.Volume
......@@ -1406,7 +1404,7 @@ Mutes or unmutes a stream. This API uses a promise to return the result.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [mute](#mute9) in **AudioVolumeGroupManager**.
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [mute](#mute9) in **AudioVolumeGroupManager**. The substitute API is available only for system applications.
**System capability**: SystemCapability.Multimedia.Audio.Volume
......@@ -1566,7 +1564,7 @@ Sets the ringer mode. This API uses an asynchronous callback to return the resul
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setRingerMode](#setringermode9) in **AudioVolumeGroupManager**.
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setRingerMode](#setringermode9) in **AudioVolumeGroupManager**. The substitute API is available only for system applications.
**Required permissions**: ohos.permission.ACCESS_NOTIFICATION_POLICY
......@@ -1601,7 +1599,8 @@ Sets the ringer mode. This API uses a promise to return the result.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setRingerMode](#setringermode9) in **AudioVolumeGroupManager**.
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [setRingerMode](#setringermode9) in **AudioVolumeGroupManager**. The substitute API is available only for system applications.
**Required permissions**: ohos.permission.ACCESS_NOTIFICATION_POLICY
......@@ -2003,13 +2002,13 @@ audioManager.isMicrophoneMute().then((value) => {
});
```
### on('volumeChange')<sup>(deprecated)</sup>
### on('volumeChange')<sup>9+</sup>
on(type: 'volumeChange', callback: Callback\<VolumeEvent>): void
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [on](#on9) in **AudioVolumeManager**.
> You are advised to use [on('volumeChange')](#onvolumechange9) in **AudioVolumeManager**.
Subscribes to system volume change events.
......@@ -2024,7 +2023,7 @@ Currently, when multiple **AudioManager** instances are used in a single process
| Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value **'volumeChange'** means the system volume change event, which is triggered when a system volume change is detected.|
| callback | Callback<[VolumeEvent](#volumeevent8)> | Yes | Callback used to return the system volume change event. |
| callback | Callback<[VolumeEvent](#volumeevent9)> | Yes | Callback used to return the system volume change event. |
**Example**
......@@ -2073,7 +2072,7 @@ Subscribes to device change events. When a device is connected or disconnected,
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [on](#on9) in **AudioRoutingManager**.
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [on('deviceChange')](#ondevicechange9) in **AudioRoutingManager**.
**System capability**: SystemCapability.Multimedia.Audio.Device
......@@ -2103,7 +2102,7 @@ Unsubscribes from device change events.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [off](#off9) in **AudioRoutingManager**.
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [off('deviceChange')](#offdevicechange9) in **AudioRoutingManager**.
**System capability**: SystemCapability.Multimedia.Audio.Device
......@@ -2338,7 +2337,7 @@ Subscribes to system volume change events. This API uses an asynchronous callbac
| Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value **'volumeChange'** means the system volume change event, which is triggered when the system volume changes.|
| callback | Callback<[VolumeEvent](#volumeevent8)> | Yes | Callback used to return the system volume change event. |
| callback | Callback<[VolumeEvent](#volumeevent9)> | Yes | Callback used to return the system volume change event. |
**Error codes**
......@@ -3465,7 +3464,7 @@ audioRoutingManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG).then((data)
});
```
### on<sup>9+</sup>
### on('deviceChange')<sup>9+</sup>
on(type: 'deviceChange', deviceFlag: DeviceFlag, callback: Callback<DeviceChangeAction\>): void
......@@ -3500,7 +3499,7 @@ audioRoutingManager.on('deviceChange', audio.DeviceFlag.OUTPUT_DEVICES_FLAG, (de
});
```
### off<sup>9+</sup>
### off('deviceChange')<sup>9+</sup>
off(type: 'deviceChange', callback?: Callback<DeviceChangeAction\>): void
......@@ -3934,6 +3933,126 @@ async function selectOutputDeviceByFilter(){
}
```
### getPreferOutputDeviceForRendererInfo<sup>10+</sup>
getPreferOutputDeviceForRendererInfo(rendererInfo: AudioRendererInfo, callback: AsyncCallback&lt;AudioDeviceDescriptors&gt;): void
Obtains the output device with the highest priority based on the audio renderer information. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.Audio.Device
**Parameters**
| Name | Type | Mandatory| Description |
| --------------------------- | ------------------------------------------------------------ | ---- | ------------------------- |
| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | Yes | Audio renderer information. |
| callback | AsyncCallback&lt;[AudioDeviceDescriptors](#audiodevicedescriptors)&gt; | Yes | Callback used to return the information about the output device with the highest priority.|
**Example**
```js
let rendererInfo = {
content : audio.ContentType.CONTENT_TYPE_MUSIC,
usage : audio.StreamUsage.STREAM_USAGE_MEDIA,
rendererFlags : 0 };
async function getPreferOutputDevice() {
audioRoutingManager.getPreferOutputDeviceForRendererInfo(rendererInfo, (err, desc) => {
if (err) {
console.error(`Result ERROR: ${JSON.stringify(err)}`);
} else {
console.info('device descriptor: ' + JSON.stringify(desc));
}
});
}
```
### getPreferOutputDeviceForRendererInfo<sup>9+</sup>
getPreferOutputDeviceForRendererInfo(rendererInfo: AudioRendererInfo): Promise&lt;AudioDeviceDescriptors&gt;
Obtains the output device with the highest priority based on the audio renderer information. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.Audio.Device
**Parameters**
| Name | Type | Mandatory| Description |
| ----------------------| ------------------------------------------------------------ | ---- | ------------------------- |
| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | Yes | Audio renderer information. |
**Return value**
| Type | Description |
| --------------------- | --------------------------- |
| Promise&lt;[AudioDeviceDescriptors](#audiodevicedescriptors)&gt; | Promise used to return the information about the output device with the highest priority.|
**Example**
```js
let rendererInfo = {
content : audio.ContentType.CONTENT_TYPE_MUSIC,
usage : audio.StreamUsage.STREAM_USAGE_MEDIA,
rendererFlags : 0 };
async function getPreferOutputDevice() {
audioRoutingManager.getPreferOutputDeviceForRendererInfo(rendererInfo).then((desc) => {
console.info('device descriptor: ' + JSON.stringify(desc));
}).catch((err) => {
console.error(`Result ERROR: ${JSON.stringify(err)}`);
})
}
```
### on('preferOutputDeviceChangeForRendererInfo')<sup>10+</sup>
on(type: 'preferOutputDeviceChangeForRendererInfo', rendererInfo: AudioRendererInfo, callback: Callback<AudioDeviceDescriptors\>): void
Subscribes to the change of the output device with the highest priority. This API uses an asynchronous callback to return the result.
**Parameters**
| Name | Type | Mandatory| Description |
| :------- | :--------------------------------------------------- | :--- | :----------------------------------------- |
| type | string | Yes | Event type. The value **'preferOutputDeviceChangeForRendererInfo'** means the event triggered when the output device with the highest priority changes.|
| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | Yes | Audio renderer information. |
| callback | Callback<[AudioDeviceDescriptors](#audiodevicedescriptors)\> | Yes | Callback used to return the information about the output device with the highest priority. |
**Example**
```js
let rendererInfo = {
content : audio.ContentType.CONTENT_TYPE_MUSIC,
usage : audio.StreamUsage.STREAM_USAGE_MEDIA,
rendererFlags : 0 };
audioRoutingManager.on('preferOutputDeviceChangeForRendererInfo', rendererInfo, (desc) => {
console.info('device descriptor: ' + JSON.stringify(desc));
});
```
### off('preferOutputDeviceChangeForRendererInfo')<sup>10+</sup>
off(type: 'preferOutputDeviceChangeForRendererInfo', callback?: Callback<AudioDeviceDescriptors\>): void
Unsubscribes from the change of the output device with the highest priority.
**System capability**: SystemCapability.Multimedia.Audio.Device
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------- | ---- | ------------------------------------------ |
| type | string | Yes | Event type. The value **'preferOutputDeviceChangeForRendererInfo'** means the event triggered when the output device with the highest priority changes.|
| callback | Callback<[AudioDeviceDescriptors](#audiodevicedescriptors)> | No | Callback used for unsubscription. |
**Example**
```js
audioRoutingManager.off('preferOutputDeviceChangeForRendererInfo', () => {
console.info('Should be no callback.');
});
```
## AudioRendererChangeInfoArray<sup>9+</sup>
Defines an **AudioRenderChangeInfo** array, which is read-only.
......@@ -3947,16 +4066,16 @@ Describes the audio renderer change event.
**System capability**: SystemCapability.Multimedia.Audio.Renderer
| Name | Type | Readable | Writable | Description |
| ------------- | ---------------------------------------- | -------- | -------- | ---------------------------------------------------------- |
| ----------------- | ------------------------------------------------- | -------- | -------- | ---------------------------------------------------------- |
| streamId | number | Yes | No | Unique ID of an audio stream. |
| clientUid | number | Yes | No | UID of the audio renderer client.<br>This is a system API. |
| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | Yes | No | Audio renderer information. |
| rendererState | [AudioState](#audiostate) | Yes | No | Audio state.<br>This is a system API. |
| deviceDescriptors | [AudioDeviceDescriptors](#audiodevicedescriptors) | Yes | No | Audio device description. |
**Example**
```js
import audio from '@ohos.multimedia.audio';
const audioManager = audio.getAudioManager();
......@@ -4005,11 +4124,12 @@ Describes the audio capturer change event.
**System capability**: SystemCapability.Multimedia.Audio.Capturer
| Name | Type | Readable | Writable | Description |
| ------------- | ---------------------------------------- | -------- | -------- | ---------------------------------------------------------- |
| ----------------- | ------------------------------------------------- | -------- | -------- | ---------------------------------------------------------- |
| streamId | number | Yes | No | Unique ID of an audio stream. |
| clientUid | number | Yes | No | UID of the audio capturer client.<br>This is a system API. |
| capturerInfo | [AudioCapturerInfo](#audiocapturerinfo8) | Yes | No | Audio capturer information. |
| capturerState | [AudioState](#audiostate) | Yes | No | Audio state.<br>This is a system API. |
| deviceDescriptors | [AudioDeviceDescriptors](#audiodevicedescriptors) | Yes | No | Audio device description. |
**Example**
......@@ -4103,7 +4223,7 @@ Implements filter criteria. Before calling **selectOutputDeviceByFilter**, you m
| Name | Type | Mandatory | Description |
| ------------ | ---------------------------------------- | --------- | ------------------------------------------------------------ |
| uid | number | Yes | Application ID.<br> **System capability**: SystemCapability.Multimedia.Audio.Core |
| uid | number | No | Application ID.<br> **System capability**: SystemCapability.Multimedia.Audio.Core |
| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | No | Audio renderer information.<br> **System capability**: SystemCapability.Multimedia.Audio.Renderer |
| rendererId | number | No | Unique ID of an audio stream.<br> **System capability**: SystemCapability.Multimedia.Audio.Renderer |
......@@ -4241,6 +4361,7 @@ audioRenderer.getStreamInfo().then((streamInfo) => {
}).catch((err) => {
console.error(`ERROR: ${err}`);
});
```
### getAudioStreamId<sup>9+</sup>
......@@ -4263,6 +4384,7 @@ Obtains the stream ID of this **AudioRenderer** instance. This API uses an async
audioRenderer.getAudioStreamId((err, streamid) => {
console.info(`Renderer GetStreamId: ${streamid}`);
});
```
### getAudioStreamId<sup>9+</sup>
......@@ -4287,6 +4409,7 @@ audioRenderer.getAudioStreamId().then((streamid) => {
}).catch((err) => {
console.error(`ERROR: ${err}`);
});
```
### start<sup>8+</sup>
......@@ -4313,6 +4436,7 @@ audioRenderer.start((err) => {
console.info('Renderer start success.');
}
});
```
### start<sup>8+</sup>
......@@ -4337,6 +4461,7 @@ audioRenderer.start().then(() => {
}).catch((err) => {
console.error(`ERROR: ${err}`);
});
```
### pause<sup>8+</sup>
......@@ -4363,6 +4488,7 @@ audioRenderer.pause((err) => {
console.info('Renderer paused.');
}
});
```
### pause<sup>8+</sup>
......@@ -4387,6 +4513,7 @@ audioRenderer.pause().then(() => {
}).catch((err) => {
console.error(`ERROR: ${err}`);
});
```
### drain<sup>8+</sup>
......@@ -4413,6 +4540,7 @@ audioRenderer.drain((err) => {
console.info('Renderer drained.');
}
});
```
### drain<sup>8+</sup>
......@@ -4437,6 +4565,7 @@ audioRenderer.drain().then(() => {
}).catch((err) => {
console.error(`ERROR: ${err}`);
});
```
### stop<sup>8+</sup>
......@@ -4463,6 +4592,7 @@ audioRenderer.stop((err) => {
console.info('Renderer stopped.');
}
});
```
### stop<sup>8+</sup>
......@@ -4487,6 +4617,7 @@ audioRenderer.stop().then(() => {
}).catch((err) => {
console.error(`ERROR: ${err}`);
});
```
### release<sup>8+</sup>
......@@ -4513,6 +4644,7 @@ audioRenderer.release((err) => {
console.info('Renderer released.');
}
});
```
### release<sup>8+</sup>
......@@ -4537,6 +4669,7 @@ audioRenderer.release().then(() => {
}).catch((err) => {
console.error(`ERROR: ${err}`);
});
```
### write<sup>8+</sup>
......@@ -4592,6 +4725,7 @@ for (let i = 0;i < len; i++) {
})
}
```
### write<sup>8+</sup>
......@@ -4641,6 +4775,7 @@ for (let i = 0;i < len; i++) {
console.error(`audioRenderer.write err: ${err}`);
}
}
```
### getAudioTime<sup>8+</sup>
......@@ -4663,6 +4798,7 @@ Obtains the number of nanoseconds elapsed from the Unix epoch (January 1, 1970).
audioRenderer.getAudioTime((err, timestamp) => {
console.info(`Current timestamp: ${timestamp}`);
});
```
### getAudioTime<sup>8+</sup>
......@@ -4687,6 +4823,7 @@ audioRenderer.getAudioTime().then((timestamp) => {
}).catch((err) => {
console.error(`ERROR: ${err}`);
});
```
### getBufferSize<sup>8+</sup>
......@@ -4711,6 +4848,7 @@ let bufferSize = audioRenderer.getBufferSize(async(err, bufferSize) => {
console.error('getBufferSize error');
}
});
```
### getBufferSize<sup>8+</sup>
......@@ -4737,6 +4875,7 @@ audioRenderer.getBufferSize().then((data) => {
}).catch((err) => {
console.error(`AudioFrameworkRenderLog: getBufferSize: ERROR: ${err}`);
});
```
### setRenderRate<sup>8+</sup>
......@@ -4764,6 +4903,7 @@ audioRenderer.setRenderRate(audio.AudioRendererRate.RENDER_RATE_NORMAL, (err) =>
console.info('Callback invoked to indicate a successful render rate setting.');
}
});
```
### setRenderRate<sup>8+</sup>
......@@ -4794,6 +4934,7 @@ audioRenderer.setRenderRate(audio.AudioRendererRate.RENDER_RATE_NORMAL).then(()
}).catch((err) => {
console.error(`ERROR: ${err}`);
});
```
### getRenderRate<sup>8+</sup>
......@@ -4816,6 +4957,7 @@ Obtains the current render rate. This API uses an asynchronous callback to retur
audioRenderer.getRenderRate((err, renderrate) => {
console.info(`getRenderRate: ${renderrate}`);
});
```
### getRenderRate<sup>8+</sup>
......@@ -4840,7 +4982,9 @@ audioRenderer.getRenderRate().then((renderRate) => {
}).catch((err) => {
console.error(`ERROR: ${err}`);
});
```
### setInterruptMode<sup>9+</sup>
setInterruptMode(mode: InterruptMode): Promise&lt;void&gt;
......@@ -4870,7 +5014,9 @@ audioRenderer.setInterruptMode(mode).then(data=>{
}).catch((err) => {
console.error(`setInterruptMode Fail: ${err}`);
});
```
### setInterruptMode<sup>9+</sup>
setInterruptMode(mode: InterruptMode, callback: AsyncCallback\<void>): void
......@@ -4896,6 +5042,7 @@ audioRenderer.setInterruptMode(mode, (err, data)=>{
}
console.info('setInterruptMode Success!');
});
```
### setVolume<sup>9+</sup>
......@@ -4926,7 +5073,9 @@ audioRenderer.setVolume(0.5).then(data=>{
}).catch((err) => {
console.error(`setVolume Fail: ${err}`);
});
```
### setVolume<sup>9+</sup>
setVolume(volume: number, callback: AsyncCallback\<void>): void
......@@ -4951,6 +5100,7 @@ audioRenderer.setVolume(0.5, (err, data)=>{
}
console.info('setVolume Success!');
});
```
### on('audioInterrupt')<sup>9+</sup>
......@@ -5030,6 +5180,7 @@ async function onAudioInterrupt(){
}
});
}
```
### on('markReach')<sup>8+</sup>
......@@ -5056,6 +5207,7 @@ audioRenderer.on('markReach', 1000, (position) => {
console.info('ON Triggered successfully');
}
});
```
......@@ -5077,6 +5229,7 @@ Unsubscribes from mark reached events.
```js
audioRenderer.off('markReach');
```
### on('periodReach') <sup>8+</sup>
......@@ -5103,6 +5256,7 @@ audioRenderer.on('periodReach', 1000, (position) => {
console.info('ON Triggered successfully');
}
});
```
### off('periodReach') <sup>8+</sup>
......@@ -5123,9 +5277,10 @@ Unsubscribes from period reached events.
```js
audioRenderer.off('periodReach')
```
### on('stateChange') <sup>8+</sup>
### on('stateChange')<sup>8+</sup>
on(type: 'stateChange', callback: Callback<AudioState\>): void
......@@ -5151,6 +5306,7 @@ audioRenderer.on('stateChange', (state) => {
console.info('audio renderer state is: STATE_RUNNING');
}
});
```
## AudioCapturer<sup>8+</sup>
......@@ -5169,6 +5325,7 @@ Provides APIs for audio capture. Before calling any API in **AudioCapturer**, yo
```js
let state = audioCapturer.state;
```
### getCapturerInfo<sup>8+</sup>
......@@ -5197,6 +5354,7 @@ audioCapturer.getCapturerInfo((err, capturerInfo) => {
console.info(`Capturer flags: ${capturerInfo.capturerFlags}`);
}
});
```
......@@ -5229,6 +5387,7 @@ audioCapturer.getCapturerInfo().then((audioParamsGet) => {
}).catch((err) => {
console.error(`AudioFrameworkRecLog: CapturerInfo :ERROR: ${err}`);
});
```
### getStreamInfo<sup>8+</sup>
......@@ -5259,6 +5418,7 @@ audioCapturer.getStreamInfo((err, streamInfo) => {
console.info(`Capturer encoding type: ${streamInfo.encodingType}`);
}
});
```
### getStreamInfo<sup>8+</sup>
......@@ -5287,6 +5447,7 @@ audioCapturer.getStreamInfo().then((audioParamsGet) => {
}).catch((err) => {
console.error(`getStreamInfo :ERROR: ${err}`);
});
```
### getAudioStreamId<sup>9+</sup>
......@@ -5309,6 +5470,7 @@ Obtains the stream ID of this **AudioCapturer** instance. This API uses an async
audioCapturer.getAudioStreamId((err, streamid) => {
console.info(`audioCapturer GetStreamId: ${streamid}`);
});
```
### getAudioStreamId<sup>9+</sup>
......@@ -5333,6 +5495,7 @@ audioCapturer.getAudioStreamId().then((streamid) => {
}).catch((err) => {
console.error(`ERROR: ${err}`);
});
```
### start<sup>8+</sup>
......@@ -5359,6 +5522,7 @@ audioCapturer.start((err) => {
console.info('Capturer start success.');
}
});
```
......@@ -5390,6 +5554,7 @@ audioCapturer.start().then(() => {
}).catch((err) => {
console.info(`AudioFrameworkRecLog: Capturer start :ERROR : ${err}`);
});
```
### stop<sup>8+</sup>
......@@ -5416,6 +5581,7 @@ audioCapturer.stop((err) => {
console.info('Capturer stopped.');
}
});
```
......@@ -5445,6 +5611,7 @@ audioCapturer.stop().then(() => {
}).catch((err) => {
console.info(`AudioFrameworkRecLog: Capturer stop: ERROR: ${err}`);
});
```
### release<sup>8+</sup>
......@@ -5471,6 +5638,7 @@ audioCapturer.release((err) => {
console.info('capturer released.');
}
});
```
......@@ -5500,6 +5668,7 @@ audioCapturer.release().then(() => {
}).catch((err) => {
console.info(`AudioFrameworkRecLog: Capturer stop: ERROR: ${err}`);
});
```
### read<sup>8+</sup>
......@@ -5533,6 +5702,7 @@ audioCapturer.read(bufferSize, true, async(err, buffer) => {
console.info('Success in reading the buffer data');
}
});
```
### read<sup>8+</sup>
......@@ -5572,6 +5742,7 @@ audioCapturer.read(bufferSize, true).then((buffer) => {
}).catch((err) => {
console.info(`ERROR : ${err}`);
});
```
### getAudioTime<sup>8+</sup>
......@@ -5594,6 +5765,7 @@ Obtains the number of nanoseconds elapsed from the Unix epoch (January 1, 1970).
audioCapturer.getAudioTime((err, timestamp) => {
console.info(`Current timestamp: ${timestamp}`);
});
```
### getAudioTime<sup>8+</sup>
......@@ -5618,6 +5790,7 @@ audioCapturer.getAudioTime().then((audioTime) => {
}).catch((err) => {
console.info(`AudioFrameworkRecLog: AudioCapturer Created : ERROR : ${err}`);
});
```
### getBufferSize<sup>8+</sup>
......@@ -5647,6 +5820,7 @@ audioCapturer.getBufferSize((err, bufferSize) => {
});
}
});
```
### getBufferSize<sup>8+</sup>
......@@ -5673,6 +5847,7 @@ audioCapturer.getBufferSize().then((data) => {
}).catch((err) => {
console.info(`AudioFrameworkRecLog: getBufferSize :ERROR : ${err}`);
});
```
### on('markReach')<sup>8+</sup>
......@@ -5699,6 +5874,7 @@ audioCapturer.on('markReach', 1000, (position) => {
console.info('ON Triggered successfully');
}
});
```
### off('markReach')<sup>8+</sup>
......@@ -5719,6 +5895,7 @@ Unsubscribes from mark reached events.
```js
audioCapturer.off('markReach');
```
### on('periodReach')<sup>8+</sup>
......@@ -5745,6 +5922,7 @@ audioCapturer.on('periodReach', 1000, (position) => {
console.info('ON Triggered successfully');
}
});
```
### off('periodReach')<sup>8+</sup>
......@@ -5765,9 +5943,10 @@ Unsubscribes from period reached events.
```js
audioCapturer.off('periodReach')
```
### on('stateChange') <sup>8+</sup>
### on('stateChange')<sup>8+</sup>
on(type: 'stateChange', callback: Callback<AudioState\>): void
......@@ -5793,6 +5972,7 @@ audioCapturer.on('stateChange', (state) => {
console.info('audio capturer state is: STATE_RUNNING');
}
});
```
## ToneType<sup>9+</sup>
......@@ -5867,6 +6047,7 @@ tonePlayer.load(audio.ToneType.TONE_TYPE_DIAL_5, (err) => {
console.info('callback call load success');
}
});
```
### load<sup>9+</sup>
......@@ -5899,6 +6080,7 @@ tonePlayer.load(audio.ToneType.TONE_TYPE_DIAL_1).then(() => {
}).catch(() => {
console.error('promise call load fail');
});
```
### start<sup>9+</sup>
......@@ -5928,6 +6110,7 @@ tonePlayer.start((err) => {
console.info('callback call start success');
}
});
```
### start<sup>9+</sup>
......@@ -5954,6 +6137,7 @@ tonePlayer.start().then(() => {
}).catch(() => {
console.error('promise call start fail');
});
```
### stop<sup>9+</sup>
......@@ -5983,6 +6167,7 @@ tonePlayer.stop((err) => {
console.error('callback call stop success ');
}
});
```
### stop<sup>9+</sup>
......@@ -6009,6 +6194,7 @@ tonePlayer.stop().then(() => {
}).catch(() => {
console.error('promise call stop fail');
});
```
### release<sup>9+</sup>
......@@ -6038,6 +6224,7 @@ tonePlayer.release((err) => {
console.info('callback call release success ');
}
});
```
### release<sup>9+</sup>
......@@ -6064,6 +6251,7 @@ tonePlayer.release().then(() => {
}).catch(() => {
console.error('promise call release fail');
});
```
## ActiveDeviceType<sup>(deprecated)</sup>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册