This commit is contained in:
parent
3299585e6a
commit
afad5c6e5c
|
@ -8,6 +8,7 @@ package libebur128
|
|||
import "C"
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Ebur128Mode int
|
||||
|
@ -120,6 +121,25 @@ func GetLoudnessGlobalMultiple(states []*State) (out float64, err error) {
|
|||
return float64(i), nil
|
||||
}
|
||||
|
||||
//SetMaxWindow Set the maximum window duration.
|
||||
func (s *State) SetMaxWindow(window time.Duration) (err error) {
|
||||
ret := C.ebur128_set_max_window(s.p, C.ulong(window.Milliseconds()))
|
||||
if ret != C.EBUR128_SUCCESS {
|
||||
return fmt.Errorf("error calculating loudness: %d", ret)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
//GetLoudnessWindow Get loudness of the specified window in LUFS.
|
||||
func (s *State) GetLoudnessWindow(window time.Duration) (out float64, err error) {
|
||||
var i C.double
|
||||
ret := C.ebur128_loudness_window(s.p, C.ulong(window.Milliseconds()), &i)
|
||||
if ret != C.EBUR128_SUCCESS {
|
||||
return float64(i), fmt.Errorf("error calculating loudness: %d", ret)
|
||||
}
|
||||
return float64(i), nil
|
||||
}
|
||||
|
||||
//GetLoudnessMomentary Get momentary loudness (last 400ms) in LUFS.
|
||||
func (s *State) GetLoudnessMomentary() (out float64, err error) {
|
||||
var i C.double
|
||||
|
|
Loading…
Reference in a new issue