EmbeddedAudioSource

constructor(@NonNull audioDataProvider: DataProvider, @NonNull audioEncoding: AudioEncoding, @IntRange(from = 1) sampleRate: Int, @IntRange(from = 8) sampleSize: Int, @IntRange(from = 1) channels: Int, @Nullable description: String)

Constructs an embedded audio source with data served from a DataProvider.

Parameters

audioDataProvider

Provider for audio data that should be saved in the document. Expects audio data stored in Big-endian with interleaved channels.

sampleRate

Sample rate of the audio data in Hz.

channels

Number of channels in the audio data.

description

The optional description of the audio data. If set, this will be set as Contents on the created sound annotation (setContents).


constructor(@NonNull audioData: Array<Byte>, @NonNull audioEncoding: AudioEncoding, @IntRange(from = 1) sampleRate: Int, @IntRange(from = 8) sampleSize: Int, @IntRange(from = 1) channels: Int, @Nullable description: String)

Constructs an embedded audio source with data served from memory.

Parameters

audioData

Audio data that should be saved in the document. Expects audio data stored in Big-endian with interleaved channels.

sampleRate

Sample rate of the audio data in Hz.

channels

Number of channels in the audio data.

description

The optional description of the audio data. If set, this will be set as Contents on the created sound annotation (setContents).