Documentation
¶
Index ¶
- type Bitcrush
- func (bitcrush *Bitcrush) Active() bool
- func (bitcrush *Bitcrush) ApplyEffect(p []byte, bytesRead int)
- func (bitcrush *Bitcrush) Clone() resound.IEffect
- func (bitcrush *Bitcrush) Read(p []byte) (n int, err error)
- func (bitcrush *Bitcrush) Seek(offset int64, whence int) (int64, error)
- func (bitcrush *Bitcrush) SetActive(active bool) *Bitcrush
- func (bitcrush *Bitcrush) SetSource(source io.ReadSeeker)
- func (bitcrush *Bitcrush) SetStrength(bitcrushFactor float64) *Bitcrush
- func (bitcrush *Bitcrush) Strength() float64
- type Delay
- func (delay *Delay) Active() bool
- func (delay *Delay) ApplyEffect(p []byte, bytesRead int)
- func (delay *Delay) Clone() resound.IEffect
- func (delay *Delay) Feedback() float64
- func (delay *Delay) Read(p []byte) (n int, err error)
- func (delay *Delay) Seek(offset int64, whence int) (int64, error)
- func (delay *Delay) SetActive(active bool) *Delay
- func (delay *Delay) SetFeedback(feedbackPercentage float64) *Delay
- func (delay *Delay) SetSource(source io.ReadSeeker)
- func (delay *Delay) SetStrength(strength float64) *Delay
- func (delay *Delay) SetWait(waitTime float64) *Delay
- func (delay *Delay) Strength() float64
- func (delay *Delay) Wait() float64
- type Distort
- func (distort *Distort) Active() bool
- func (distort *Distort) ApplyEffect(p []byte, bytesRead int)
- func (distort *Distort) Clone() resound.IEffect
- func (distort *Distort) CrushPercentage() float64
- func (distort *Distort) Read(p []byte) (n int, err error)
- func (distort *Distort) Seek(offset int64, whence int) (int64, error)
- func (distort *Distort) SetActive(active bool) *Distort
- func (distort *Distort) SetCrushPercentage(strength float64) *Distort
- func (distort *Distort) SetSource(source io.ReadSeeker)
- type HighpassFilter
- func (h *HighpassFilter) Active() bool
- func (h *HighpassFilter) ApplyEffect(p []byte, bytesRead int)
- func (h *HighpassFilter) Clone() resound.IEffect
- func (h *HighpassFilter) Read(p []byte) (n int, err error)
- func (h *HighpassFilter) Seek(offset int64, whence int) (int64, error)
- func (h *HighpassFilter) SetActive(active bool) *HighpassFilter
- func (h *HighpassFilter) SetSource(source io.ReadSeeker)
- func (h *HighpassFilter) SetStrength(strength float64) *HighpassFilter
- func (h *HighpassFilter) Strength() float64
- type LowpassFilter
- func (lpf *LowpassFilter) Active() bool
- func (lpf *LowpassFilter) ApplyEffect(p []byte, bytesRead int)
- func (lpf *LowpassFilter) Clone() resound.IEffect
- func (lpf *LowpassFilter) Read(p []byte) (n int, err error)
- func (lpf *LowpassFilter) Seek(offset int64, whence int) (int64, error)
- func (lpf *LowpassFilter) SetActive(active bool) *LowpassFilter
- func (lpf *LowpassFilter) SetSource(source io.ReadSeeker)
- func (lpf *LowpassFilter) SetStrength(strength float64) *LowpassFilter
- func (lpf *LowpassFilter) Strength() float64
- type Pan
- func (pan *Pan) Active() bool
- func (pan *Pan) ApplyEffect(p []byte, bytesRead int)
- func (pan *Pan) Clone() resound.IEffect
- func (pan *Pan) Pan() float64
- func (pan *Pan) Read(p []byte) (n int, err error)
- func (pan *Pan) Seek(offset int64, whence int) (int64, error)
- func (pan *Pan) SetActive(active bool) *Pan
- func (pan *Pan) SetPan(panPercent float64) *Pan
- func (pan *Pan) SetSource(source io.ReadSeeker)
- type PitchShift
- func (p *PitchShift) Active() bool
- func (p *PitchShift) ApplyEffect(byteSlice []byte, bytesRead int)
- func (p *PitchShift) Clone() resound.IEffect
- func (p *PitchShift) Pitch() float64
- func (p *PitchShift) Read(byteSlice []byte) (n int, err error)
- func (p *PitchShift) Seek(offset int64, whence int) (int64, error)
- func (p *PitchShift) SetActive(active bool) *PitchShift
- func (p *PitchShift) SetPitch(pitchFactor float64) *PitchShift
- func (p *PitchShift) SetSource(source io.ReadSeeker)
- func (p *PitchShift) SetStrength(strength float64) *PitchShift
- func (p *PitchShift) Strength() float64
- type Volume
- func (volume *Volume) Active() bool
- func (volume *Volume) ApplyEffect(p []byte, bytesRead int)
- func (volume *Volume) Clone() resound.IEffect
- func (volume *Volume) Read(p []byte) (n int, err error)
- func (volume *Volume) Seek(offset int64, whence int) (int64, error)
- func (volume *Volume) SetActive(active bool) *Volume
- func (volume *Volume) SetNormalizationFactor(normalization float64)
- func (volume *Volume) SetSource(source io.ReadSeeker)
- func (volume *Volume) SetStrength(strength float64) *Volume
- func (volume *Volume) Strength() float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bitcrush ¶
type Bitcrush struct { Source io.ReadSeeker // contains filtered or unexported fields }
Bitcrush is an effect that changes the pitch of the incoming audio byte stream.
func NewBitcrush ¶
func NewBitcrush(source io.ReadSeeker) *Bitcrush
NewBitcrush creates a new Bitcrush effect. source is the source stream to apply this effect to. If you add this effect to a DSPChannel, there's no need to pass a source, as it will take effect for whatever streams are played through the DSPChannel.
func (*Bitcrush) ApplyEffect ¶
func (*Bitcrush) SetSource ¶
func (bitcrush *Bitcrush) SetSource(source io.ReadSeeker)
SetSource sets the active source for the effect.
func (*Bitcrush) SetStrength ¶
SetStrength sets the strength of the Bitcrush effect to the specified percentage.
type Delay ¶
type Delay struct { Source io.ReadSeeker // contains filtered or unexported fields }
Delay is an effect that adds a delay to the sound.
func NewDelay ¶
func NewDelay(source io.ReadSeeker) *Delay
NewDelay creates a new Delay effect. If you add this effect to a DSPChannel, source can be nil, as it will take effect for whatever streams are played through the DSPChannel.
func (*Delay) ApplyEffect ¶
func (*Delay) SetFeedback ¶ added in v0.2.0
SetFeedback sets the feedback percentage of the delay. Each echo's volume is modulated by this percentage.
func (*Delay) SetSource ¶
func (delay *Delay) SetSource(source io.ReadSeeker)
SetSource sets the active source for the effect.
func (*Delay) SetStrength ¶
SetStrength sets the overall volume of the Delay effect as it's added on top of the original signal. 0 is the minimum value.
func (*Delay) SetWait ¶
SetWait sets the overall wait time of the Delay effect in seconds as it's added on top of the original signal. 0 is the minimum value.
type Distort ¶
type Distort struct { Source io.ReadSeeker // contains filtered or unexported fields }
Distort distorts the stream that plays through it, clipping the signal.
func NewDistort ¶
func NewDistort(source io.ReadSeeker) *Distort
NewDistort creates a new Distort effect. source is the source stream to apply the effect to. If you add this effect to a DSPChannel, you can pass nil as the source, as it will take effect for whatever streams are played through the DSPChannel.
func (*Distort) ApplyEffect ¶
func (*Distort) CrushPercentage ¶
CrushPercentage returns the crush percentage of the Distort effect.
func (*Distort) SetCrushPercentage ¶
SetCrushPercentage sets the overall crush percentage of the Distort effect. Any value below this in percentage amplitude is rounded off. 0 is the minimum value.
func (*Distort) SetSource ¶
func (distort *Distort) SetSource(source io.ReadSeeker)
SetSource sets the active source for the effect.
type HighpassFilter ¶ added in v0.2.0
type HighpassFilter struct { Source io.ReadSeeker // contains filtered or unexported fields }
HighpassFilter represents a highpass filter for an audio stream.
func NewHighpassFilter ¶ added in v0.2.0
func NewHighpassFilter(source io.ReadSeeker) *HighpassFilter
NewHighpassFilter creates a new high-pass filter for the given source stream. If you add this effect to a DSPChannel, there's no need to pass a source, as it will take effect for whatever streams are played through the DSPChannel.
func (*HighpassFilter) Active ¶ added in v0.2.0
func (h *HighpassFilter) Active() bool
Active returns if the effect is active.
func (*HighpassFilter) ApplyEffect ¶ added in v0.2.0
func (h *HighpassFilter) ApplyEffect(p []byte, bytesRead int)
func (*HighpassFilter) Clone ¶ added in v0.2.0
func (h *HighpassFilter) Clone() resound.IEffect
Clone clones the effect, returning an resound.IEffect.
func (*HighpassFilter) Read ¶ added in v0.2.0
func (h *HighpassFilter) Read(p []byte) (n int, err error)
func (*HighpassFilter) Seek ¶ added in v0.2.0
func (h *HighpassFilter) Seek(offset int64, whence int) (int64, error)
func (*HighpassFilter) SetActive ¶ added in v0.2.0
func (h *HighpassFilter) SetActive(active bool) *HighpassFilter
SetActive sets the effect to be active.
func (*HighpassFilter) SetSource ¶ added in v0.2.0
func (h *HighpassFilter) SetSource(source io.ReadSeeker)
SetSource sets the active source for the effect.
func (*HighpassFilter) SetStrength ¶ added in v0.2.0
func (h *HighpassFilter) SetStrength(strength float64) *HighpassFilter
SetStrength sets the strength of the HighpassFilter. The values are clamped from 0 to 1 (100%).
func (*HighpassFilter) Strength ¶ added in v0.2.0
func (h *HighpassFilter) Strength() float64
Strength returns the strength of the HighpassFilter.
type LowpassFilter ¶
type LowpassFilter struct { Source io.ReadSeeker // contains filtered or unexported fields }
LowpassFilter represents a low-pass filter for a source audio stream.
func NewLowpassFilter ¶
func NewLowpassFilter(source io.ReadSeeker) *LowpassFilter
NewLowpassFilter creates a new low-pass filter for the given source stream. If you add this effect to a DSPChannel, there's no need to pass a source, as it will take effect for whatever streams are played through the DSPChannel.
func (*LowpassFilter) Active ¶
func (lpf *LowpassFilter) Active() bool
Active returns if the effect is active.
func (*LowpassFilter) ApplyEffect ¶
func (lpf *LowpassFilter) ApplyEffect(p []byte, bytesRead int)
func (*LowpassFilter) Clone ¶
func (lpf *LowpassFilter) Clone() resound.IEffect
Clone clones the effect, returning an resound.IEffect.
func (*LowpassFilter) Seek ¶
func (lpf *LowpassFilter) Seek(offset int64, whence int) (int64, error)
func (*LowpassFilter) SetActive ¶
func (lpf *LowpassFilter) SetActive(active bool) *LowpassFilter
SetActive sets the effect to be active.
func (*LowpassFilter) SetSource ¶
func (lpf *LowpassFilter) SetSource(source io.ReadSeeker)
SetSource sets the active source for the effect.
func (*LowpassFilter) SetStrength ¶
func (lpf *LowpassFilter) SetStrength(strength float64) *LowpassFilter
func (*LowpassFilter) Strength ¶
func (lpf *LowpassFilter) Strength() float64
type Pan ¶
type Pan struct { Source io.ReadSeeker // contains filtered or unexported fields }
Pan is a panning effect, handling panning the sound between the left and right channels.
func NewPan ¶
func NewPan(source io.ReadSeeker) *Pan
NewPan creates a new Pan effect. source is the source stream to apply the effect on. Panning defaults to 0. If you add this effect to a DSPChannel, source can be nil, as it will take effect for whatever streams are played through the DSPChannel.
func (*Pan) ApplyEffect ¶
func (*Pan) Pan ¶
Pan returns the panning value for the pan effect in a percentage, ranging from -1 (hard left) to 1 (hard right).
func (*Pan) SetPan ¶
SetPan sets the panning percentage for the pan effect. The possible values range from -1 (hard left) to 1 (hard right).
func (*Pan) SetSource ¶
func (pan *Pan) SetSource(source io.ReadSeeker)
SetSource sets the active source for the effect.
type PitchShift ¶ added in v0.2.0
type PitchShift struct { Source io.ReadSeeker // contains filtered or unexported fields }
PitchShift is an effect that changes the pitch of the incoming audio stream.
func NewPitchShift ¶ added in v0.2.0
func NewPitchShift(source io.ReadSeeker, bufferSize int) *PitchShift
NewPitchShift creates a new PitchShift effect. source is the source stream to apply this effect to. If you add this effect to a DSPChannel, source can be nil, as it will take effect for whatever streams are played through the DSPChannel.
func (*PitchShift) Active ¶ added in v0.2.0
func (p *PitchShift) Active() bool
Active returns if the effect is active.
func (*PitchShift) ApplyEffect ¶ added in v0.2.0
func (p *PitchShift) ApplyEffect(byteSlice []byte, bytesRead int)
func (*PitchShift) Clone ¶ added in v0.2.0
func (p *PitchShift) Clone() resound.IEffect
Clone clones the effect, returning an resound.IEffect.
func (*PitchShift) Pitch ¶ added in v0.2.0
func (p *PitchShift) Pitch() float64
Pitch returns the pitch of the PitchShift effect as a percentage.
func (*PitchShift) Read ¶ added in v0.2.0
func (p *PitchShift) Read(byteSlice []byte) (n int, err error)
func (*PitchShift) Seek ¶ added in v0.2.0
func (p *PitchShift) Seek(offset int64, whence int) (int64, error)
func (*PitchShift) SetActive ¶ added in v0.2.0
func (p *PitchShift) SetActive(active bool) *PitchShift
SetActive sets the effect to be active.
func (*PitchShift) SetPitch ¶ added in v0.2.0
func (p *PitchShift) SetPitch(pitchFactor float64) *PitchShift
SetPitch sets the target pitch of the PitchShift effect to the specified percentage. The lowest possible value is 0.0, with 1.0 being 100% pitch.
func (*PitchShift) SetSource ¶ added in v0.2.0
func (p *PitchShift) SetSource(source io.ReadSeeker)
SetSource sets the active source for the effect.
func (*PitchShift) SetStrength ¶ added in v0.2.0
func (p *PitchShift) SetStrength(strength float64) *PitchShift
SetStrength sets the strength of the PitchShift effect to the specified percentage. The lowest possible value is 0.0, with 1.0 being the maximum and taking a 100% effect.
func (*PitchShift) Strength ¶ added in v0.2.0
func (p *PitchShift) Strength() float64
Strength returns the strength of the PitchShift effect as a percentage. The value ranges from 0 to 1.
type Volume ¶
type Volume struct { Source io.ReadSeeker // contains filtered or unexported fields }
Volume is an effect that changes the overall volume of the incoming audio byte stream.
func NewVolume ¶
func NewVolume(source io.ReadSeeker) *Volume
NewVolume creates a new Volume effect. source is the source stream to apply this effect to. If you add this effect to a DSPChannel, source can be nil, as it will take effect for whatever streams are played through the DSPChannel.
func (*Volume) ApplyEffect ¶
func (*Volume) SetNormalizationFactor ¶
SetNormalizationFactor sets the normalization factor for the Volume effect. This should be obtained from an AudioProperties Analysis.
func (*Volume) SetSource ¶
func (volume *Volume) SetSource(source io.ReadSeeker)
SetSource sets the active source for the effect.
func (*Volume) SetStrength ¶
SetStrength sets the strength of the Volume effect to the specified percentage. The lowest possible value is 0.0, with 1.0 taking a 100% effect. The volume is altered on a sine-based easing curve. At over 100% volume, the sound is clipped as necessary.