Documentation
¶
Overview ¶
Package ebur128 implements EBU R-128 loudness measurement (integrated loudness, true peak, loudness range).
Only 48 kHz is supported.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelLayout ¶
type ChannelLayout int
const ( LayoutStereo ChannelLayout = iota // 2ch: L, R Layout51 // 6ch: L, R, C, LFE, Ls, Rs )
type Meter ¶
type Meter struct {
// contains filtered or unexported fields
}
Example ¶
package main
import (
"fmt"
"github.com/exaring/ebur128"
)
func main() {
meter, _ := ebur128.New(ebur128.LayoutStereo, 48000)
buf := make([]float64, 48000*2) // 1 sec stereo silence
meter.Write(buf)
res := meter.Loudness()
fmt.Printf("I: %.1f LUFS\n", res.IntegratedLoudness)
}
Output: I: -99.0 LUFS
func (*Meter) Finalize ¶
func (m *Meter) Finalize()
Finalize flushes any incomplete sub-block (zero-padded). Idempotent.
func (*Meter) Loudness ¶
Loudness returns the measurement. Call Finalize first to include trailing samples.
func (*Meter) WriteFloat32 ¶
type Result ¶
type Result struct {
IntegratedLoudness float64 // LUFS (gated)
TruePeak float64 // dBTP, max across channels
LoudnessRange float64 // LU; 0 if unmeasurable
// Number of 400ms blocks that passed both gates (0 = unmeasurable).
GatedBlockCount int
// Number of 3s windows that passed both gates for LRA (<2 = unmeasurable).
LRAGatedWindowCount int
}
Result of a loudness measurement. Fields are set to loudnessUnmeasurable (-99) when the input is too short or fully gated out.
Click to show internal directories.
Click to hide internal directories.