Documentation
¶
Overview ¶
Package gosamplerate is a golang binding for libsamplerate (audio sample rate converter)
Index ¶
- Constants
- func Delete(src Src) error
- func Error(errNo int) string
- func GetDescription(converter C.int) (string, error)
- func GetName(converter C.int) (string, error)
- func GetVersion() string
- func IsValidRatio(ratio float64) bool
- func Simple(dataIn []float32, ratio float64, channels int, converterType int) ([]float32, error)
- type Src
Constants ¶
const ( SRC_SINC_BEST_QUALITY = C.SRC_SINC_BEST_QUALITY SRC_SINC_MEDIUM_QUALITY = C.SRC_SINC_MEDIUM_QUALITY SRC_SINC_FASTEST = C.SRC_SINC_FASTEST SRC_ZERO_ORDER_HOLD = C.SRC_ZERO_ORDER_HOLD SRC_LINEAR = C.SRC_LINEAR )
Variables ¶
This section is empty.
Functions ¶
func GetDescription ¶
GetDescription returns the description of a sample rate converter
func IsValidRatio ¶
IsValidRatio returns True is ratio is a valid conversion ratio, False otherwise.
func Simple ¶
Simple converts a single block of samples (one or more channels) in one go. The simple API is less capable than the full API (Process()). It must not be used if Audio shall be converted in chunks. For full documentation see: http://www.mega-nerd.com/SRC/api_simple.html
Types ¶
type Src ¶
type Src struct {
// contains filtered or unexported fields
}
Src struct holding the data for the full API
func (*Src) GetChannels ¶
GetChannels gets the current channel count.
func (*Src) Process ¶
Process is known as the full API. It allows time varying sample rate conversion on streaming data on one or more channels. For full documentation see: http://www.mega-nerd.com/SRC/api_full.html
func (*Src) Reset ¶
Reset the internal SRC state. It does not modify the quality settings. It does not free any memory allocations.
func (*Src) SetRatio ¶
SetRatio sets the samplerate conversion ratio between input and output samples. Normally, when using (src *SRC) Process or the callback, the library will try to smoothly transition between the conversion ratio of the last call and the conversion ratio of the next call. This function bypasses this behaviour and achieves a step response in the conversion rate.