Class SoundBuffer

ru.yandex.speechkit

public  class  SoundBuffer 

The class contains a data buffer and information on the audio.

Constructors

SoundBuffer(byte[] data, SoundInfo soundInfo)

Creates an object of the SoundBuffer class.

Methods

longcalculateDurationMs(@NonNull final SoundBuffer buffer)

Calculates the duration of the SoundBuffer in milliseconds.

byte[]getData()

Returns the data buffer.

SoundInfogetSoundInfo()

Returns Information on the audio.

StringtoString()

Constructor Detail

SoundBuffer

public SoundBuffer (byte[] data, SoundInfo soundInfo)

Creates an object of the SoundBuffer class.

Parameters:
data

Raw audio data stored as byte[].

soundInfo

Sound attributes.

Method Detail

calculateDurationMs

public static long calculateDurationMs (@NonNull final SoundBuffer buffer)

Calculates the duration of the SoundBuffer in milliseconds.

Parameters:
buffer

An object of the SoundBuffer class.

Returns:

Duration of the SoundBuffer in milliseconds.

getData

public byte[] getData ()

Returns the data buffer.

Returns:

Data buffer.

getSoundInfo

public SoundInfo getSoundInfo ()

Returns Information on the audio.

Returns:

Information on the audio.

toString

public String toString ()