java.lang.Object | |
↳ | com.pspdfkit.annotations.sound.EmbeddedAudioSource |
Represents a source of audio data that can be embedded inside a SoundAnnotation
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DURATION_UNKNOWN | Constant value returned from getDuration() to signal an error during retrieval of
the actual audio clip duration. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
EmbeddedAudioSource(DataProvider audioDataProvider, AudioEncoding audioEncoding, int sampleRate, int sampleSize, int channels, String description)
Constructs an embedded audio source with data served from a
DataProvider . | |||||||||||
EmbeddedAudioSource(byte[] audioData, AudioEncoding audioEncoding, int sampleRate, int sampleSize, int channels, String description)
Constructs an embedded audio source with data served from memory.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AudioEncoding |
getAudioEncoding()
Audio samples encoding.
| ||||||||||
int |
getChannels()
The number of audio channels.
| ||||||||||
DataProvider |
getDataProvider()
Returns data provider with audio data in
ENCODING_PCM_16BIT format. | ||||||||||
String |
getDescription()
Returns audio data description.
| ||||||||||
long |
getDuration()
Audio duration in millisecond.
| ||||||||||
int |
getSampleRate()
The sampling rate, in samples per second.
| ||||||||||
int |
getSampleSize()
The number of bits per sample value per channel.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Constant value returned from getDuration()
to signal an error during retrieval of
the actual audio clip duration.
Constructs an embedded audio source with data served from a DataProvider
.
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(String) ).
|
Constructs an embedded audio source with data served from memory.
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(String) ).
|
Audio samples encoding.
The number of audio channels.
Returns data provider with audio data in ENCODING_PCM_16BIT
format.
This will always return non-null even if sound source was created from in-memory data - wrapping the in-memory audio data in MemoryDataProvider.
DataProvider
which serves the audio data.
Returns audio data description.
null
if not set.
Audio duration in millisecond.
DURATION_UNKNOWN
if duration is
unknown.
The sampling rate, in samples per second.
The number of bits per sample value per channel.