From 4e8022455cd185fef163ccaab745a671b846c1df Mon Sep 17 00:00:00 2001 From: Gloria Date: Thu, 6 Apr 2023 17:51:57 +0800 Subject: [PATCH] Update docs against 14261 Signed-off-by: wusongqing --- .../reference/apis/js-apis-audio.md | 266 +++++++++++++++--- 1 file changed, 227 insertions(+), 39 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-audio.md b/en/application-dev/reference/apis/js-apis-audio.md index b3f5def410..65340798c5 100644 --- a/en/application-dev/reference/apis/js-apis-audio.md +++ b/en/application-dev/reference/apis/js-apis-audio.md @@ -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. | -## VolumeEvent8+ +## VolumeEvent9+ 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**.| -| updateUi | boolean | Yes | Whether to show the volume change in UI. | -| volumeGroupId9+ | number | Yes | Volume group ID. It can be used as an input parameter of **getGroupManager**. | -| networkId9+ | string | Yes | Network ID. | +| volumeType | [AudioVolumeType](#audiovolumetype) | Yes | Audio stream type. | +| 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 | number | Yes | Volume group ID. It can be used as an input parameter of **getGroupManager**.
This is a system API. | +| networkId | string | Yes | Network ID.
This is a system API. | ## MicStateChangeEvent9+ @@ -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')(deprecated) +### on('volumeChange')9+ on(type: 'volumeChange', callback: Callback\): 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) }); ``` -### on9+ +### on('deviceChange')9+ on(type: 'deviceChange', deviceFlag: DeviceFlag, callback: Callback): void @@ -3500,7 +3499,7 @@ audioRoutingManager.on('deviceChange', audio.DeviceFlag.OUTPUT_DEVICES_FLAG, (de }); ``` -### off9+ +### off('deviceChange')9+ off(type: 'deviceChange', callback?: Callback): void @@ -3934,6 +3933,126 @@ async function selectOutputDeviceByFilter(){ } ``` +### getPreferOutputDeviceForRendererInfo10+ + +getPreferOutputDeviceForRendererInfo(rendererInfo: AudioRendererInfo, callback: AsyncCallback<AudioDeviceDescriptors>): 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<[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 }; + +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)); + } + }); +} +``` + +### getPreferOutputDeviceForRendererInfo9+ + +getPreferOutputDeviceForRendererInfo(rendererInfo: AudioRendererInfo): Promise<AudioDeviceDescriptors> + +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<[AudioDeviceDescriptors](#audiodevicedescriptors)> | 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')10+ + +on(type: 'preferOutputDeviceChangeForRendererInfo', rendererInfo: AudioRendererInfo, callback: Callback): 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')10+ + +off(type: 'preferOutputDeviceChangeForRendererInfo', callback?: Callback): 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.'); +}); +``` + ## AudioRendererChangeInfoArray9+ Defines an **AudioRenderChangeInfo** array, which is read-only. @@ -3946,17 +4065,17 @@ 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.
This is a system API. | -| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | Yes | No | Audio renderer information. | -| rendererState | [AudioState](#audiostate) | Yes | No | Audio state.
This is a system API. | +| 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.
This is a system API. | +| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | Yes | No | Audio renderer information. | +| rendererState | [AudioState](#audiostate) | Yes | No | Audio state.
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(); @@ -4004,12 +4123,13 @@ 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.
This is a system API. | -| capturerInfo | [AudioCapturerInfo](#audiocapturerinfo8) | Yes | No | Audio capturer information. | -| capturerState | [AudioState](#audiostate) | Yes | No | Audio state.
This is a system API. | +| 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.
This is a system API. | +| capturerInfo | [AudioCapturerInfo](#audiocapturerinfo8) | Yes | No | Audio capturer information. | +| capturerState | [AudioState](#audiostate) | Yes | No | Audio state.
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.
**System capability**: SystemCapability.Multimedia.Audio.Core | +| uid | number | No | Application ID.
**System capability**: SystemCapability.Multimedia.Audio.Core | | rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | No | Audio renderer information.
**System capability**: SystemCapability.Multimedia.Audio.Renderer | | rendererId | number | No | Unique ID of an audio stream.
**System capability**: SystemCapability.Multimedia.Audio.Renderer | @@ -4241,6 +4361,7 @@ audioRenderer.getStreamInfo().then((streamInfo) => { }).catch((err) => { console.error(`ERROR: ${err}`); }); + ``` ### getAudioStreamId9+ @@ -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}`); }); + ``` ### getAudioStreamId9+ @@ -4287,6 +4409,7 @@ audioRenderer.getAudioStreamId().then((streamid) => { }).catch((err) => { console.error(`ERROR: ${err}`); }); + ``` ### start8+ @@ -4313,6 +4436,7 @@ audioRenderer.start((err) => { console.info('Renderer start success.'); } }); + ``` ### start8+ @@ -4337,6 +4461,7 @@ audioRenderer.start().then(() => { }).catch((err) => { console.error(`ERROR: ${err}`); }); + ``` ### pause8+ @@ -4363,6 +4488,7 @@ audioRenderer.pause((err) => { console.info('Renderer paused.'); } }); + ``` ### pause8+ @@ -4387,6 +4513,7 @@ audioRenderer.pause().then(() => { }).catch((err) => { console.error(`ERROR: ${err}`); }); + ``` ### drain8+ @@ -4413,6 +4540,7 @@ audioRenderer.drain((err) => { console.info('Renderer drained.'); } }); + ``` ### drain8+ @@ -4437,6 +4565,7 @@ audioRenderer.drain().then(() => { }).catch((err) => { console.error(`ERROR: ${err}`); }); + ``` ### stop8+ @@ -4463,6 +4592,7 @@ audioRenderer.stop((err) => { console.info('Renderer stopped.'); } }); + ``` ### stop8+ @@ -4487,6 +4617,7 @@ audioRenderer.stop().then(() => { }).catch((err) => { console.error(`ERROR: ${err}`); }); + ``` ### release8+ @@ -4513,6 +4644,7 @@ audioRenderer.release((err) => { console.info('Renderer released.'); } }); + ``` ### release8+ @@ -4537,6 +4669,7 @@ audioRenderer.release().then(() => { }).catch((err) => { console.error(`ERROR: ${err}`); }); + ``` ### write8+ @@ -4592,6 +4725,7 @@ for (let i = 0;i < len; i++) { }) } + ``` ### write8+ @@ -4641,6 +4775,7 @@ for (let i = 0;i < len; i++) { console.error(`audioRenderer.write err: ${err}`); } } + ``` ### getAudioTime8+ @@ -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}`); }); + ``` ### getAudioTime8+ @@ -4687,6 +4823,7 @@ audioRenderer.getAudioTime().then((timestamp) => { }).catch((err) => { console.error(`ERROR: ${err}`); }); + ``` ### getBufferSize8+ @@ -4711,6 +4848,7 @@ let bufferSize = audioRenderer.getBufferSize(async(err, bufferSize) => { console.error('getBufferSize error'); } }); + ``` ### getBufferSize8+ @@ -4737,6 +4875,7 @@ audioRenderer.getBufferSize().then((data) => { }).catch((err) => { console.error(`AudioFrameworkRenderLog: getBufferSize: ERROR: ${err}`); }); + ``` ### setRenderRate8+ @@ -4764,6 +4903,7 @@ audioRenderer.setRenderRate(audio.AudioRendererRate.RENDER_RATE_NORMAL, (err) => console.info('Callback invoked to indicate a successful render rate setting.'); } }); + ``` ### setRenderRate8+ @@ -4794,6 +4934,7 @@ audioRenderer.setRenderRate(audio.AudioRendererRate.RENDER_RATE_NORMAL).then(() }).catch((err) => { console.error(`ERROR: ${err}`); }); + ``` ### getRenderRate8+ @@ -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}`); }); + ``` ### getRenderRate8+ @@ -4840,7 +4982,9 @@ audioRenderer.getRenderRate().then((renderRate) => { }).catch((err) => { console.error(`ERROR: ${err}`); }); + ``` + ### setInterruptMode9+ setInterruptMode(mode: InterruptMode): Promise<void> @@ -4870,7 +5014,9 @@ audioRenderer.setInterruptMode(mode).then(data=>{ }).catch((err) => { console.error(`setInterruptMode Fail: ${err}`); }); + ``` + ### setInterruptMode9+ setInterruptMode(mode: InterruptMode, callback: AsyncCallback\): void @@ -4896,6 +5042,7 @@ audioRenderer.setInterruptMode(mode, (err, data)=>{ } console.info('setInterruptMode Success!'); }); + ``` ### setVolume9+ @@ -4926,7 +5073,9 @@ audioRenderer.setVolume(0.5).then(data=>{ }).catch((err) => { console.error(`setVolume Fail: ${err}`); }); + ``` + ### setVolume9+ setVolume(volume: number, callback: AsyncCallback\): void @@ -4951,6 +5100,7 @@ audioRenderer.setVolume(0.5, (err, data)=>{ } console.info('setVolume Success!'); }); + ``` ### on('audioInterrupt')9+ @@ -4976,7 +5126,7 @@ For details about the error codes, see [Audio Error Codes](../errorcodes/errorco | ID | Error Message | | ------- | ------------------------------ | -| 6800101 | if input parameter value error | +| 6800101 | if input parameter value error | **Example** @@ -5030,6 +5180,7 @@ async function onAudioInterrupt(){ } }); } + ``` ### on('markReach')8+ @@ -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') 8+ @@ -5103,6 +5256,7 @@ audioRenderer.on('periodReach', 1000, (position) => { console.info('ON Triggered successfully'); } }); + ``` ### off('periodReach') 8+ @@ -5123,9 +5277,10 @@ Unsubscribes from period reached events. ```js audioRenderer.off('periodReach') + ``` -### on('stateChange') 8+ +### on('stateChange')8+ on(type: 'stateChange', callback: Callback): void @@ -5151,6 +5306,7 @@ audioRenderer.on('stateChange', (state) => { console.info('audio renderer state is: STATE_RUNNING'); } }); + ``` ## AudioCapturer8+ @@ -5169,6 +5325,7 @@ Provides APIs for audio capture. Before calling any API in **AudioCapturer**, yo ```js let state = audioCapturer.state; + ``` ### getCapturerInfo8+ @@ -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}`); }); + ``` ### getStreamInfo8+ @@ -5259,6 +5418,7 @@ audioCapturer.getStreamInfo((err, streamInfo) => { console.info(`Capturer encoding type: ${streamInfo.encodingType}`); } }); + ``` ### getStreamInfo8+ @@ -5287,6 +5447,7 @@ audioCapturer.getStreamInfo().then((audioParamsGet) => { }).catch((err) => { console.error(`getStreamInfo :ERROR: ${err}`); }); + ``` ### getAudioStreamId9+ @@ -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}`); }); + ``` ### getAudioStreamId9+ @@ -5333,6 +5495,7 @@ audioCapturer.getAudioStreamId().then((streamid) => { }).catch((err) => { console.error(`ERROR: ${err}`); }); + ``` ### start8+ @@ -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}`); }); + ``` ### stop8+ @@ -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}`); }); + ``` ### release8+ @@ -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}`); }); + ``` ### read8+ @@ -5533,6 +5702,7 @@ audioCapturer.read(bufferSize, true, async(err, buffer) => { console.info('Success in reading the buffer data'); } }); + ``` ### read8+ @@ -5572,6 +5742,7 @@ audioCapturer.read(bufferSize, true).then((buffer) => { }).catch((err) => { console.info(`ERROR : ${err}`); }); + ``` ### getAudioTime8+ @@ -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}`); }); + ``` ### getAudioTime8+ @@ -5618,6 +5790,7 @@ audioCapturer.getAudioTime().then((audioTime) => { }).catch((err) => { console.info(`AudioFrameworkRecLog: AudioCapturer Created : ERROR : ${err}`); }); + ``` ### getBufferSize8+ @@ -5647,6 +5820,7 @@ audioCapturer.getBufferSize((err, bufferSize) => { }); } }); + ``` ### getBufferSize8+ @@ -5673,6 +5847,7 @@ audioCapturer.getBufferSize().then((data) => { }).catch((err) => { console.info(`AudioFrameworkRecLog: getBufferSize :ERROR : ${err}`); }); + ``` ### on('markReach')8+ @@ -5699,6 +5874,7 @@ audioCapturer.on('markReach', 1000, (position) => { console.info('ON Triggered successfully'); } }); + ``` ### off('markReach')8+ @@ -5719,6 +5895,7 @@ Unsubscribes from mark reached events. ```js audioCapturer.off('markReach'); + ``` ### on('periodReach')8+ @@ -5745,6 +5922,7 @@ audioCapturer.on('periodReach', 1000, (position) => { console.info('ON Triggered successfully'); } }); + ``` ### off('periodReach')8+ @@ -5765,9 +5943,10 @@ Unsubscribes from period reached events. ```js audioCapturer.off('periodReach') + ``` -### on('stateChange') 8+ +### on('stateChange')8+ on(type: 'stateChange', callback: Callback): void @@ -5793,6 +5972,7 @@ audioCapturer.on('stateChange', (state) => { console.info('audio capturer state is: STATE_RUNNING'); } }); + ``` ## ToneType9+ @@ -5867,6 +6047,7 @@ tonePlayer.load(audio.ToneType.TONE_TYPE_DIAL_5, (err) => { console.info('callback call load success'); } }); + ``` ### load9+ @@ -5899,6 +6080,7 @@ tonePlayer.load(audio.ToneType.TONE_TYPE_DIAL_1).then(() => { }).catch(() => { console.error('promise call load fail'); }); + ``` ### start9+ @@ -5928,6 +6110,7 @@ tonePlayer.start((err) => { console.info('callback call start success'); } }); + ``` ### start9+ @@ -5954,6 +6137,7 @@ tonePlayer.start().then(() => { }).catch(() => { console.error('promise call start fail'); }); + ``` ### stop9+ @@ -5983,6 +6167,7 @@ tonePlayer.stop((err) => { console.error('callback call stop success '); } }); + ``` ### stop9+ @@ -6009,6 +6194,7 @@ tonePlayer.stop().then(() => { }).catch(() => { console.error('promise call stop fail'); }); + ``` ### release9+ @@ -6038,6 +6224,7 @@ tonePlayer.release((err) => { console.info('callback call release success '); } }); + ``` ### release9+ @@ -6064,6 +6251,7 @@ tonePlayer.release().then(() => { }).catch(() => { console.error('promise call release fail'); }); + ``` ## ActiveDeviceType(deprecated) -- GitLab