Versions in this module Expand all Collapse all v1 v1.0.0 Mar 15, 2020 Changes in this version + const CyclesPerSecond + const DurationPerCycle + const MaxDuration + const MaxLength + const SecondsPerCycle + func DurationToSamples(duration time.Duration) uint64 + func SamplesToDuration(sampleCount uint64) time.Duration + func SawtoothMap(at float64) float64 + func SineMap(at float64) float64 + func SquareMap(at float64) float64 + func TriangleMap(at float64) float64 + type BaseSound struct + func (s *BaseSound) Duration() time.Duration + func (s *BaseSound) GetSamples() <-chan float64 + func (s *BaseSound) Length() uint64 + func (s *BaseSound) Reset() + func (s *BaseSound) Running() bool + func (s *BaseSound) Start() + func (s *BaseSound) Stop() + func (s *BaseSound) String() string + func (s *BaseSound) WriteSample(sample float64) bool + type ChannelSound struct + func (s *ChannelSound) Duration() time.Duration + func (s *ChannelSound) GetSamples() <-chan float64 + func (s *ChannelSound) Length() uint64 + func (s *ChannelSound) Reset() + func (s *ChannelSound) Running() bool + func (s *ChannelSound) Start() + func (s *ChannelSound) Stop() + func (s *ChannelSound) String() string + type SimpleSampleMap func(float64) float64 + type Sound interface + Duration func() time.Duration + GetSamples func() <-chan float64 + Length func() uint64 + Reset func() + Running func() bool + Start func() + Stop func() + func AddDelay(wrapped Sound, delayMs float64) Sound + func ConcatSounds(wrapped ...Sound) Sound + func LinearSample(wrapped Sound, pitchScale float64) Sound + func MultiplyWithClip(wrapped Sound, factor float64) Sound + func NewADSREnvelope(wrapped Sound, attackMs float64, delayMs float64, sustainLevel float64, ...) Sound + func NewBaseSound(def SoundDefinition, sampleCount uint64) Sound + func NewDenseIIR(wrapped Sound, inCoef []float64, outCoef []float64) Sound + func NewHzFromChannel(wrapped <-chan float64) Sound + func NewHzFromChannelWithAmplitude(wrappedWithAmplitute <-chan []float64) Sound + func NewKarplusStrong(hz float64, sustain float64) Sound + func NewSawtoothWave(hz float64) Sound + func NewSilence() Sound + func NewSimpleWave(hz float64, mapper SimpleSampleMap) Sound + func NewSineWave(hz float64) Sound + func NewSquareWave(hz float64) Sound + func NewTimedSilence(durationMs float64) Sound + func NewTimedSound(wrapped Sound, durationMs float64) Sound + func NewTriangleWave(hz float64) Sound + func RepeatSound(wrapped Sound, loopCount int32) Sound + func SumSounds(wrapped ...Sound) Sound + func WrapChannelAsSound(samples <-chan float64) Sound + func WrapSliceAsSound(samples []float64) Sound + type SoundDefinition interface + Reset func() + Run func(base *BaseSound) + Stop func()