View Source KinoLiveAudio (kino_live_audio v0.1.1)

A Kino designed to record a raw audio stream (no client-side encoding) and emit events.

When you consume the events, you can directly convert the audio to an Nx tensor.

You may specify the sample rate of the audio and the frequency that events should be emmitted by specifying how many samples should accumulate before sending to the server.

Refer to the sample Livebook for usage.

Summary

Functions

Creates a new KinoLiveAudio

Options

  • :chunk_size - Wait for this many samples before sending. Will send exactly this amount to the emmited event. Must be a positive integer. Defaults to 16_000.
  • :sample_rate - The sample rate of the audio stream. Defaults to 16_000.
  • :unit - The unit for the :chunk_size option. Can be any of the following:
    • :samples - Directly passes the :chunk_size parameter
    • :s - Seconds of audio before sending, according to the sample rate
    • :ms - Miliseconds of audio before sending, according to the sample rate
    • :mu - Microseconds of audio before sending, according to the sample rate