# `Kino.Audio`
[🔗](https://github.com/livebook-dev/kino/blob/v0.19.0/lib/kino/audio.ex#L1)

A kino for rendering a binary audio.

## Examples

    content = File.read!("/path/to/audio.wav")
    Kino.Audio.new(content, :wav)

    content = File.read!("/path/to/audio.wav")
    Kino.Audio.new(content, :wav, autoplay: true, loop: true)

# `common_audio_type`

```elixir
@type common_audio_type() :: :wav | :mp3 | :mpeg | :ogg
```

# `mime_type`

```elixir
@type mime_type() :: binary()
```

# `t`

```elixir
@type t() :: Kino.JS.Live.t()
```

# `new`

```elixir
@spec new(binary(), common_audio_type() | mime_type(), keyword()) :: t()
```

Creates a new kino displaying the given binary audio.

The given type can be either `:wav`, `:mp3`/`:mpeg`, `:ogg`
or a string with audio MIME type.

## Options

  * `:autoplay` - whether the audio should start playing as soon as
    it is rendered. Defaults to `false`

  * `:loop` - whether the audio should loop. Defaults to `false`

  * `:muted` - whether the audio should be muted. Defaults to `false`

# `pause`

```elixir
@spec pause(t()) :: :ok
```

Makes a given kino stop playing the audio.

# `play`

```elixir
@spec play(t()) :: :ok
```

Makes a given kino play the audio.

Play has no effect if the audio is already playing.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
