openharmony 鸿蒙 arkts-apis-audio-t

2026-08-25 浏览 (1)

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

TypeDescription
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

TypeDescription
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

TypeDescription
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

TypeDescription
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

NameTypeMandatoryDescription
dataArrayBufferYesData to be written to the buffer.

Return value

TypeDescription
AudioDataCallbackResult |voidIf 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 鸿蒙 capi-ohaudio

openharmony 鸿蒙 capi-ohmidi

openharmony 鸿蒙 arkts-apis-audio-AudioManager

openharmony 鸿蒙 capi-ohaudiosuite-oh-audiosuite-spacerenderpositionparams

openharmony 鸿蒙 capi-ohaudio-oh-audiostreaminfo

openharmony 鸿蒙 errorcode-ringtone

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/lUp4tylp