Documentation ¶
Overview ¶
Package signal provides functionality for manipulate digital signals and its attributes.
Index ¶
- Constants
- type BitDepth
- type Float64
- func (floats Float64) Append(source Float64) Float64
- func (floats Float64) AsInterInt(bitDepth BitDepth, unsigned bool) InterInt
- func (floats Float64) CopyToInterInt(ints InterInt)
- func (floats Float64) NumChannels() int
- func (floats Float64) Size() int
- func (floats Float64) Slice(start, len int) Float64
- func (floats Float64) Sum(b Float64) Float64
- type Int
- type InterInt
- type SampleRate
Constants ¶
const ( // BitDepth8 is 8 bit depth. BitDepth8 = BitDepth(8) // BitDepth16 is 16 bit depth. BitDepth16 = BitDepth(16) // BitDepth24 is 32 bit depth. BitDepth24 = BitDepth(24) // BitDepth32 is 32 bit depth. BitDepth32 = BitDepth(32) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Float64 ¶
type Float64 [][]float64
Float64 is a non-interleaved float64 signal.
func Float64Buffer ¶
Float64Buffer returns an Float64 buffer of specified dimentions.
func (Float64) AsInterInt ¶
AsInterInt allocates new interleaved int buffer of the same size and copies signal values there. If unsigned is true, then all values are shifted and result will be in unsigned range.
func (Float64) CopyToInterInt ¶ added in v0.4.0
CopyToInterInt buffer the values of Float64 buffer. If number of channels is not equal, function will panic.
func (Float64) NumChannels ¶
NumChannels returns number of channels in this sample slice.
func (Float64) Slice ¶
Slice creates a new buffer that refers to floats data from start position with defined legth. Shorten block is returned if buffer doesn't have enough samples. If start is less than 0 or more than buffer size, nil is returned. If len goes beyond the buffer size, it's truncated up to length of the buffer.
type InterInt ¶
InterInt is an interleaved int signal.
func (InterInt) AsFloat64 ¶
AsFloat64 allocates new Float64 buffer of the same size and copies signal values there.
func (InterInt) CopyToFloat64 ¶ added in v0.4.0
CopyToFloat64 buffer the values of InterInt buffer. If number of channels is not equal, function will panic.
type SampleRate ¶ added in v0.2.0
type SampleRate uint
SampleRate is the number of samples obtained in one second.
func (SampleRate) DurationOf ¶ added in v0.2.0
func (rate SampleRate) DurationOf(samples int) time.Duration
DurationOf returns time duration of samples at this sample rate.