sox

package
v0.0.0-...-3ecf056 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GarbageCollection = false
View Source
var TempDir = os.TempDir()

TempDir is where the temporary intermediate files are held

View Source
var TempPrefix = "sox"

TempPrefix is a unique indicator of the temporary files

View Source
var TempType = "wav"

TempType is the type of file to be generated (should be "wav")

Functions

func AddComment

func AddComment(fname string, comment string) (fname2 string, err error)

func Clean

func Clean() (err error)

Clean will remove files created after each function

func Convert

func Convert(fname string, fname2 string) (err error)

func ConvertToMatch

func ConvertToMatch(fname string, fnameMatch string) (fname2 string, err error)

func CopyPaste

func CopyPaste(fname string, startPos float64, endPos float64, pastePos float64, crossfade float64, leeway0 ...float64) (fname2 string, err error)

func FFT

func FFT(fname string) (data string, err error)

FFT

func FadeIn

func FadeIn(fname string, duration float64) (fname2 string, err error)

FadeIn will fade the audio in using quarter-sine wave

func FadeOut

func FadeOut(fname string, duration float64) (fname2 string, err error)

FadeOut will fade the audio out using quarter-sine wave

func Gain

func Gain(fname string, gain float64) (fname2 string, err error)

Gain applies gain

func GetBPM

func GetBPM(name string) (beats float64, bpm float64, err error)

func GetBinary

func GetBinary() string

func GetComment

func GetComment(fname string) (comment string, err error)

func Info

func Info(fname string) (samplerate int, channels int, precision int, err error)

Info returns the sample rate and number of channels for file

func Init

func Init() (err error)

func Join

func Join(fnames ...string) (fname2 string, err error)

Join will concatonate the files

func Left

func Left(fname string) (fname2 string, err error)

Left returns only the left channel

func Length

func Length(fname string) (length float64, err error)

Length returns the length of the file in seconds

func Mix

func Mix(fnames ...string) (fname2 string, err error)

Mix will mix the files

func MustFloat

func MustFloat(t ...interface{}) float64

MustFloat returns only the first argument of any function, as a float

func MustString

func MustString(t ...interface{}) string

MustString returns only the first argument of any function, as a string

func Norm

func Norm(fname string) (fname2 string, err error)

Norm normalizes the audio

func NumSamples

func NumSamples(fname string) (numSamples int, err error)

NumSamples returns the number of samples in the file

func Onsets

func Onsets(fname string) (onsets []float64, err error)

Onsets requires aubioonset

func PCM16

func PCM16(fname string) (fname2 string, err error)

func Paste

func Paste(fname string, piece string, pasteStart float64, crossfade float64) (fname2 string, err error)

Paste pastes any piece into a place in the audio, assumes that the piece has "crossfade" length on both sides in addition to its current length.

func Pitch

func Pitch(fname string, notes int) (fname2 string, err error)

Pitch repitched the audio

func PostProcess

func PostProcess(fname string, gain float64) (fname2 string, err error)

PostProcess

func Repeat

func Repeat(fname string, n int) (fname2 string, err error)

Repeat will add n repeats to the audio

func ResampleRate

func ResampleRate(fname string, sampleRate int, precision int) (fname2 string, err error)

ResampleRate changes the sample rate and precision

func RetempoSpeed

func RetempoSpeed(fname string, old_tempo float64, new_tempo float64) (fname2 string, err error)

RetempoSpeed will change the tempo of the audio and pitch

func RetempoStretch

func RetempoStretch(fname string, old_tempo float64, new_tempo float64) (fname2 string, err error)

RetempoStretch will change the tempo of the audio trying to keep pitch similar

func Reverb

func Reverb(fname string) (fname2 string, err error)

func Reverse

func Reverse(fname string) (fname2 string, err error)

Reverse will reverse the audio

func ReverseReverb

func ReverseReverb(fname string, beat float64, beats float64) (fname2 string, err error)

ReverseReverb will reverse a piece, reverb it, reverse it back, and place it back in the position that the original note hits so it reverberates up to it.

func SampleRate

func SampleRate(fname string, srCh ...int) (fname2 string, err error)

SampleRate changes the sample rate

func SilenceAppend

func SilenceAppend(fname string, length float64) (fname2 string, err error)

SilenceAppend appends silence to a file

func SilencePrepend

func SilencePrepend(fname string, length float64) (fname2 string, err error)

SilencePrepend prepends silence to a file

func SilenceTrim

func SilenceTrim(fname string) (fname2 string, err error)

SilenceTrim trims silence around a file

func SilenceTrimEnd

func SilenceTrimEnd(fname string) (fname2 string, err error)

SilenceTrimEnd trims silence from end of file

func SilenceTrimFront

func SilenceTrimFront(fname string) (fname2 string, err error)

SilenceTrimFront trims silence from beginning of file

func Slowdown

func Slowdown(fname string, slowdown float64) (fname2 string, err error)

RetempoStretch will change the tempo of the audio trying to keep pitch similar

func Stereo

func Stereo(fname string) (fname2 string, err error)

func Stretch

func Stretch(fname string, stretch float64) (fname2 string, err error)

Stretch does a time stretch

func Stutter

func Stutter(fname string, stutter_length float64, pos_start float64, count float64, xfadePieceStutterGain ...float64) (fname2 string, err error)

Stutter does a stutter effect

func Tmpfile

func Tmpfile() string

func Trim

func Trim(fname string, start float64, length ...float64) (fname2 string, err error)

Trim will trim the audio from the start point (with optional length)

func TrimBeats

func TrimBeats(fname string) (fname2 string, tempo float64, beats float64, err error)

TrimBeats will take a filename with bpmX_beatsY.wav and trim it and make sure its the correct lenght

func Version

func Version() (out string, err error)

func Warp

func Warp(fname string, bpmSet float64, beatDivisionSet float64) (fname2 string, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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