Versions in this module Expand all Collapse all v0 v0.1.0 Jul 10, 2020 Changes in this version + var ValidChannels = utils.NewSet(1, 2) + type AudioSegment struct + func NewAudioSegment(data []byte, opts ...AudioSegmentOption) (*AudioSegment, error) + func NewAudioSegmentFromWaveAudio(waveAudio *wav.WaveAudio) (*AudioSegment, error) + func NewEmptyAudioSegment() (*AudioSegment, error) + func NewSilentAudioSegment(duration int, frameRate uint32) (*AudioSegment, error) + func (seg *AudioSegment) Add(other *AudioSegment) (*AudioSegment, error) + func (seg *AudioSegment) Append(segments ...*AudioSegment) (*AudioSegment, error) + func (seg *AudioSegment) ApplyGain(volumeChange Volume) (*AudioSegment, error) + func (seg *AudioSegment) AsWaveAudio() *wav.WaveAudio + func (seg *AudioSegment) Channels() uint16 + func (seg *AudioSegment) DBFS() Volume + func (seg *AudioSegment) Duration() time.Duration + func (seg *AudioSegment) Equal(other *AudioSegment) bool + func (seg *AudioSegment) ForkWithChannels(channels uint16) (*AudioSegment, error) + func (seg *AudioSegment) ForkWithFrameRate(frameRate int) (*AudioSegment, error) + func (seg *AudioSegment) ForkWithSampleWidth(sampleWidth int) (*AudioSegment, error) + func (seg *AudioSegment) FrameCount() float64 + func (seg *AudioSegment) FrameCountIn(d time.Duration) float64 + func (seg *AudioSegment) FrameRate() uint32 + func (seg *AudioSegment) FrameWidth() uint32 + func (seg *AudioSegment) Max() float64 + func (seg *AudioSegment) MaxDBFS() Volume + func (seg *AudioSegment) MaxPossibleAmplitude() float64 + func (seg *AudioSegment) Overlay(other *AudioSegment, config *OverlayConfig) (*AudioSegment, error) + func (seg *AudioSegment) RMS() float64 + func (seg *AudioSegment) RawData() []byte + func (seg *AudioSegment) Repeat(count int) (*AudioSegment, error) + func (seg *AudioSegment) Reverse() (*AudioSegment, error) + func (seg *AudioSegment) SampleWidth() uint16 + func (seg *AudioSegment) Slice(start, end time.Duration) (*AudioSegment, error) + func (seg *AudioSegment) String() string + type AudioSegmentError struct + func NewAudioSegmentError(format string, args ...interface{}) AudioSegmentError + func (e AudioSegmentError) Error() string + type AudioSegmentOption func(*AudioSegment) + func Channels(v uint16) AudioSegmentOption + func FrameRate(v uint32) AudioSegmentOption + func FrameWidth(v uint32) AudioSegmentOption + func SampleWidth(v uint16) AudioSegmentOption + type Exporter struct + func NewExporter(dst interface{}) *Exporter + func (e *Exporter) Export(segment *AudioSegment) error + func (e *Exporter) WithBitRate(rate int) *Exporter + func (e *Exporter) WithCodec(c string) *Exporter + func (e *Exporter) WithCover(c string) *Exporter + func (e *Exporter) WithDstFormat(f string) *Exporter + func (e *Exporter) WithID3TagVersion(v int) *Exporter + func (e *Exporter) WithParams(p ...string) *Exporter + func (e *Exporter) WithSampleRate(rate int) *Exporter + func (e *Exporter) WithTags(tags map[string]string) *Exporter + type Loader struct + func NewLoader() *Loader + func (l *Loader) Load(src interface{}) (*AudioSegment, error) + func (l *Loader) WithParams(params ...string) *Loader + type OverlayConfig struct + GainDuringOverlay Volume + LoopCount int + LoopToEnd bool + Position time.Duration + type Volume float64 + func NewVolumeFromRatio(ratio float64, denominator float64, useAmplitude bool) Volume + func (volume Volume) String() string + func (volume Volume) ToRatio(useAmplitude bool) float64