Make one stored recording small, and measure it.
A phone records a voice memo at 48 kHz in stereo, about 80 kbit/s: a 45-minute memo is 28 MB. Parakeet reads 16 kHz mono, and speech at 16 kHz mono AAC of 24 kbit/s is about 3 kB/s: the same memo is about 8 MB. A client downloads it about three times faster, and the transcriber reads exactly what it needs.
prepare runs one ffmpeg with two outputs. The first is the small AAC
recording in an MP4 box with its index at the start (faststart), so a player
can start before the end has arrived. The second is 8 kHz PCM on a pipe. From
it come the duration and the loudness bars of the waveform, so a client can
show both before it reads one byte of the audio.
This is lossy, by intent: the stored recording is the small one. The words and their times do not change, because the times of the speech stay the same.
Make one stored recording small, and measure it. A phone records a voice memo at 48 kHz in stereo, about 80 kbit/s: a 45-minute memo is 28 MB. Parakeet reads 16 kHz mono, and speech at 16 kHz mono AAC of 24 kbit/s is about 3 kB/s: the same memo is about 8 MB. A client downloads it about three times faster, and the transcriber reads exactly what it needs. [[prepare]] runs one `ffmpeg` with two outputs. The first is the small AAC recording in an MP4 box with its index at the start (`faststart`), so a player can start before the end has arrived. The second is 8 kHz PCM on a pipe. From it come the duration and the loudness bars of the waveform, so a client can show both before it reads one byte of the audio. This is lossy, by intent: the stored recording is the small one. The words and their times do not change, because the times of the speech stay the same.
The count of loudness bars of a waveform.
The count of loudness bars of a waveform.
The media type of a compacted recording.
The media type of a compacted recording.
(prepare data)The compacted recording of data and its measures, or nil when this machine has
no ffmpeg or ffmpeg cannot read data. Answers {:duration :peaks} with the
duration in seconds and bars loudness bars, and with :bytes and
:media-type when the compacted recording is smaller than [[kept-share]] of
data. Never throws.
The compacted recording of `data` and its measures, or nil when this machine has
no `ffmpeg` or `ffmpeg` cannot read `data`. Answers `{:duration :peaks}` with the
duration in seconds and [[bars]] loudness bars, and with `:bytes` and
`:media-type` when the compacted recording is smaller than [[kept-share]] of
`data`. Never throws.(start! data)Start prepare of data now, before its turn stores it. An upload holds the
bytes about 2 s before the row exists, so take-prepared then gives the
compactor a finished result. Never throws.
Start [[prepare]] of `data` now, before its turn stores it. An upload holds the bytes about 2 s before the row exists, so [[take-prepared]] then gives the compactor a finished result. Never throws.
(take-prepared data)[true result] with the result of an early prepare of data, which it then
forgets, or nil when no early run has these bytes.
`[true result]` with the result of an early [[prepare]] of `data`, which it then forgets, or nil when no early run has these bytes.
(waveform levels n)At most n loudness bars from levels, from 0 to 100, with the loudest bar at 100.
Each bar is the loudest level of its part of the recording.
At most `n` loudness bars from `levels`, from 0 to 100, with the loudest bar at 100. Each bar is the loudest level of its part of the recording.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |