audioop

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package audioop provides some useful operations on sound fragments by manipulating raw audio data. The implementation is based on the Python audioop module. More references can be found here:

  1. https://docs.python.org/2/library/audioop.html
  2. https://github.com/python/cpython/blob/master/Modules/audioop.c
  3. https://github.com/jiaaro/pydub/blob/master/pydub/pyaudioop.py

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsInt32

func AbsInt32(x int32) int32

func Add

func Add(cp1 []byte, cp2 []byte, size int) ([]byte, error)

func Avg

func Avg(cp []byte, size int) (int32, error)

func Avgpp

func Avgpp(cp []byte, size int) (int32, error)

func Bias

func Bias(cp []byte, size int, bias int) ([]byte, error)

func Cross

func Cross(cp []byte, size int) (int32, error)

func FindFactor

func FindFactor(cp1 []byte, cp2 []byte) (int32, error)

func FindFit

func FindFit(cp1 []byte, cp2 []byte) (int32, int32, error)

func FindMax

func FindMax(cp []byte, len2 int) (int32, error)

func GCD

func GCD(a, b int) int

func GetSample

func GetSample(cp []byte, size int, offset int) (int32, error)

func Int16LE

func Int16LE(b []byte) int16

func Int32LE

func Int32LE(b []byte) int32

func Int8LE

func Int8LE(b []byte) int8

func Lin2Lin

func Lin2Lin(cp []byte, size, size2 int) ([]byte, error)

func Max

func Max(cp []byte, size int) (int32, error)

func MaxInt32

func MaxInt32(x, y int32) int32

func Maxpp

func Maxpp(cp []byte, size int) (int32, error)

func MinInt32

func MinInt32(x, y int32) int32

func MinMax

func MinMax(cp []byte, size int) (int32, int32, error)

func Mul

func Mul(cp []byte, size int, factor float64) ([]byte, error)

func RMS

func RMS(cp []byte, size int) (int32, error)

RMS: Root mean square

func Reverse

func Reverse(cp []byte, size int) ([]byte, error)

func SumInt32

func SumInt32(i ...int32) int

func ToMono

func ToMono(cp []byte, size int, fac1, fac2 float64) ([]byte, error)

func ToStereo

func ToStereo(cp []byte, size int, fac1, fac2 float64) ([]byte, error)

func Uint16LE

func Uint16LE(b []byte) uint16

func Uint32LE

func Uint32LE(b []byte) uint32

func Uint8LE

func Uint8LE(b []byte) uint8

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

func NewError

func NewError(format string, args ...interface{}) Error

func (Error) Error

func (e Error) Error() string

type Int32Iterator

type Int32Iterator struct {
	// contains filtered or unexported fields
}

func NewInt32Interator

func NewInt32Interator(items []int32) *Int32Iterator

func (*Int32Iterator) Next

func (it *Int32Iterator) Next() int32

type State

type State struct {
	D     int
	Samps []struct {
		PrevI int
		CurI  int
	}
}

func NewState

func NewState(d int, prev []int, cur []int) *State

func Ratecv

func Ratecv(cp []byte, size, nChannels, inRate, outRate, weightA, weightB int) ([]byte, *State, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL