Types
NOTE
The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
AudioRendererChangeInfoArray9+
type AudioRendererChangeInfoArray = Array<Readonly<AudioRendererChangeInfo>>
Defines an AudioRendererChangeInfo array, which is read-only.
System capability: SystemCapability.Multimedia.Audio.Renderer
| Type | Description |
|---|---|
| Array<Readonly<AudioRendererChangeInfo>> | An AudioRendererChangeInfo array, which is read-only. |
AudioCapturerChangeInfoArray9+
type AudioCapturerChangeInfoArray = Array<Readonly<AudioCapturerChangeInfo>>
Defines an AudioCapturerChangeInfo array, which is read-only.
System capability: SystemCapability.Multimedia.Audio.Capturer
| Type | Description |
|---|---|
| Array<Readonly<AudioCapturerChangeInfo>> | An AudioCapturerChangeInfo array, which is read-only. |
AudioEffectInfoArray10+
type AudioEffectInfoArray = Array<Readonly<AudioEffectMode>>
Defines an array that contains the audio effect mode corresponding to a specific audio content type (specified by ContentType) and audio stream usage (specified by StreamUsage). The AudioEffectMode array is read-only.
System capability: SystemCapability.Multimedia.Audio.Renderer
| Type | Description |
|---|---|
| Array<Readonly<AudioEffectMode>> | Defines an array that contains the audio effect mode corresponding to a specific audio content type (specified by ContentType) and audio stream usage (specified by StreamUsage). The AudioEffectMode array is read-only. |
AudioDeviceDescriptors
type AudioDeviceDescriptors = Array<Readonly<AudioDeviceDescriptor>>
Defines an AudioDeviceDescriptor array, which is read-only.
Atomic service API: This API can be used in atomic services since API version 12.
System capability: SystemCapability.Multimedia.Audio.Device
| Type | Description |
|---|---|
| Array<Readonly<AudioDeviceDescriptor>> | Defines an AudioDeviceDescriptor array, which is read-only. |
AudioRendererWriteDataCallback12+
type AudioRendererWriteDataCallback = (data: ArrayBuffer) => AudioDataCallbackResult|void
Defines the callback function used to write data to the audio renderer. Once the callback function finishes its execution, the audio service queues the data pointed to by data for playback. Therefore, do not change the data outside the callback. It is crucial to fill data with the exact length of data designated for playback; otherwise, noises may occur during playback.
System capability: SystemCapability.Multimedia.Audio.Renderer
Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| data | ArrayBuffer | Yes | Data to be written to the buffer. |
Return value
| Type | Description |
|---|---|
| AudioDataCallbackResult |void | If void or AudioDataCallbackResult.VALID is returned, the data is valid and the audio data is played. If AudioDataCallbackResult.INVALID is returned, the data is invalid and the audio data is not played. |
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 capi-native-audiostreambuilder-h
openharmony 鸿蒙 capi-ohaudiosuite
openharmony 鸿蒙 js-apis-inner-multimedia-systemSoundPlayer
openharmony 鸿蒙 arkts-apis-audio-i
openharmony 鸿蒙 arkts-apis-audio-AudioManager
openharmony 鸿蒙 capi-ohaudiosuite-oh-audiosuite-spacerenderpositionparams