# AudioSink.InitializationException

Artifact: [androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/audio/AudioSink.java+class:androidx.media3.exoplayer.audio.AudioSink.InitializationException)

*** ** * ** ***


```
class AudioSink.InitializationException : Exception
```

<br />

|---|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) ||||
| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html) |||
|   | ↳ | [java.lang.Exception](https://developer.android.com/reference/java/lang/Exception.html) ||
|   |   | ↳ | [androidx.media3.exoplayer.audio.AudioSink.InitializationException](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink.InitializationException) |

*** ** * ** ***

Thrown when a failure occurs initializing the sink.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink.InitializationException#InitializationException(java.lang.String,int,androidx.media3.common.Format,boolean,java.lang.Throwable)( message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, audioTrackState: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!, isRecoverable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html? )` Creates a new instance. |
| `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink.InitializationException#InitializationException(int,int,int,int,int,androidx.media3.common.Format,boolean,java.lang.Exception)( audioTrackState: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, sampleRate: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, channelConfig: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, encoding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, bufferSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!, isRecoverable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, audioTrackException: https://developer.android.com/reference/java/lang/Exception.html? )` Creates a new instance. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink.InitializationException#audioTrackState()` The underlying `https://developer.android.com/reference/android/media/AudioTrack.html`'s state. |
| `https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink.InitializationException#format()` The input `https://developer.android.com/reference/kotlin/androidx/media3/common/Format` of the sink when the error occurs. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/audio/AudioSink.InitializationException#isRecoverable()` If the exception can be recovered by recreating the sink. |

| ### Inherited functions |
|---|
| From [java.lang.Throwable](https://developer.android.com/reference/java/lang/Throwable.html) |---|---| | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/add-suppressed.html(exception: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!)` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/fill-in-stack-trace.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-cause.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-localized-message.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-message.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html!>!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-stack-trace.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!>!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/get-suppressed.html()` | | `synchronized https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/init-cause.html(cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html!)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/print-stack-trace.html()` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/set-stack-trace.html(stackTrace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/java/lang/StackTraceElement.html!>!)` | | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/to-string.html()` | |

## Public constructors

### InitializationException

```
InitializationException(
    message: String!,
    audioTrackState: Int,
    format: Format!,
    isRecoverable: Boolean,
    cause: Throwable?
)
```

Creates a new instance.

| Parameters |
|---|---|
| `message: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | The detail message for this exception. |
| `audioTrackState: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The underlying `https://developer.android.com/reference/android/media/AudioTrack.html`'s state. |
| `format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | The input format of the sink when the error occurs. |
| `isRecoverable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the exception can be recovered by recreating the sink. |
| `cause: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-throwable/index.html?` | The `https://developer.android.com/reference/java/lang/Throwable.html` of this exception. |

### InitializationException

```
InitializationException(
    audioTrackState: Int,
    sampleRate: Int,
    channelConfig: Int,
    encoding: Int,
    bufferSize: Int,
    format: Format!,
    isRecoverable: Boolean,
    audioTrackException: Exception?
)
```

Creates a new instance.

| Parameters |
|---|---|
| `audioTrackState: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The underlying `https://developer.android.com/reference/android/media/AudioTrack.html`'s state. |
| `sampleRate: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The requested sample rate in Hz. |
| `channelConfig: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The requested channel configuration. |
| `encoding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The requested encoding. |
| `bufferSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The requested buffer size in bytes. |
| `format: https://developer.android.com/reference/kotlin/androidx/media3/common/Format!` | The input format of the sink when the error occurs. |
| `isRecoverable: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether the exception can be recovered by recreating the sink. |
| `audioTrackException: https://developer.android.com/reference/java/lang/Exception.html?` | Exception thrown during the creation of the `https://developer.android.com/reference/android/media/AudioTrack.html`. |

## Public properties

### audioTrackState

```
val audioTrackState: Int
```

The underlying `https://developer.android.com/reference/android/media/AudioTrack.html`'s state.

### format

```
val format: Format!
```

The input `https://developer.android.com/reference/kotlin/androidx/media3/common/Format` of the sink when the error occurs.

### isRecoverable

```
val isRecoverable: Boolean
```

If the exception can be recovered by recreating the sink.