AudioSink.InitializationException


public final class AudioSink.InitializationException extends Exception


Thrown when a failure occurs initializing the sink.

Summary

Public fields

final int

The underlying AudioTrack's state.

final Format

The input Format of the sink when the error occurs.

final boolean

If the exception can be recovered by recreating the sink.

Public constructors

InitializationException(
    String message,
    int audioTrackState,
    Format format,
    boolean isRecoverable,
    @Nullable Throwable cause
)

Creates a new instance.

InitializationException(
    int audioTrackState,
    int sampleRate,
    int channelConfig,
    int bufferSize,
    Format format,
    boolean isRecoverable,
    @Nullable Exception audioTrackException
)

Creates a new instance.

Inherited methods

From java.lang.Throwable
synchronized final void
synchronized Throwable
synchronized Throwable
String
String
StackTraceElement[]
synchronized final Throwable[]
synchronized Throwable
void
void
setStackTrace(StackTraceElement[] stackTrace)
String

Public fields

audioTrackState

public final int audioTrackState

The underlying AudioTrack's state.

format

public final Format format

The input Format of the sink when the error occurs.

isRecoverable

public final boolean isRecoverable

If the exception can be recovered by recreating the sink.

Public constructors

InitializationException

public InitializationException(
    String message,
    int audioTrackState,
    Format format,
    boolean isRecoverable,
    @Nullable Throwable cause
)

Creates a new instance.

Parameters
String message

The detail message for this exception.

int audioTrackState

The underlying AudioTrack's state.

Format format

The input format of the sink when the error occurs.

boolean isRecoverable

Whether the exception can be recovered by recreating the sink.

@Nullable Throwable cause

The cause of this exception.

InitializationException

public InitializationException(
    int audioTrackState,
    int sampleRate,
    int channelConfig,
    int bufferSize,
    Format format,
    boolean isRecoverable,
    @Nullable Exception audioTrackException
)

Creates a new instance.

Parameters
int audioTrackState

The underlying AudioTrack's state.

int sampleRate

The requested sample rate in Hz.

int channelConfig

The requested channel configuration.

int bufferSize

The requested buffer size in bytes.

Format format

The input format of the sink when the error occurs.

boolean isRecoverable

Whether the exception can be recovered by recreating the sink.

@Nullable Exception audioTrackException

Exception thrown during the creation of the AudioTrack.