benchmark_audio

package
v0.0.0-...-c98f1fc Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2018 License: Unlicense Imports: 1 Imported by: 0

README

Package benchmark contains different benchmarks for compiler optimizations.

audio shows two common things you might want to do in audio libraries:

  • Generate a sound for different number of channel counts:
    • Dynamic benchmarks represents code where the code has least repetition
    • Switch benchmarks shows where each channel count has different implementation. This becomes extremely repetitive, if you need to do this for each effect and buffer type.
    • Baseline benchmarks shows the ideal performance (ignoring SIMD optimizations)
  • Mix two sound buffers together:
    • Dynamic benchmark shows the code you would usually write in Go
    • Baseline benchmarks shows the ideal performance (ignoring SIMD optimizations)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate_Dynamic

func Generate_Dynamic(buf *Buffer, generate func() float32)

Generete fills audio left, right channels and rest with 0-s

func Generate_Switch

func Generate_Switch(buf *Buffer, generate func() float32)

Generete fills audio channels

func MixInto_Baseline

func MixInto_Baseline(a, b []float32)

func MixInto_Dynamic

func MixInto_Dynamic(a, b []float32)

func Mix_Baseline

func Mix_Baseline(dst, a, b []float32)

func Mix_Dynamic

func Mix_Dynamic(dst, a, b []float32)

func Sawtooth_Baseline_Ch1

func Sawtooth_Baseline_Ch1(buf Buffer_Ch1, sampleRate uint32, hz float32)

Sawtooth inlined

func Sawtooth_Baseline_Ch2

func Sawtooth_Baseline_Ch2(buf Buffer_Ch2, sampleRate uint32, hz float32)

Sawtooth inlined

func Sawtooth_Baseline_Ch5

func Sawtooth_Baseline_Ch5(buf Buffer_Ch5, sampleRate uint32, hz float32)

Sawtooth inlined

func Sawtooth_Baseline_Ch7

func Sawtooth_Baseline_Ch7(buf Buffer_Ch7, sampleRate uint32, hz float32)

Sawtooth inlined

func Sawtooth_Dynamic

func Sawtooth_Dynamic(buf *Buffer, sampleRate uint32, hz float32)

Sawtooth

func Sawtooth_Switch

func Sawtooth_Switch(buf *Buffer, sampleRate uint32, hz float32)

Sawtooth

Types

type Buffer

type Buffer struct {
	ChannelCount byte
	Data         []float32
}

Buffer represents an interleaved block of samples

type Buffer_Ch1

type Buffer_Ch1 [][1]float32

Buffer_Ch1 represents mono sound samples

type Buffer_Ch2

type Buffer_Ch2 [][2]float32

Buffer_Ch2 represents stereo sound samples

type Buffer_Ch5

type Buffer_Ch5 [][5]float32

Buffer_Ch5 represents surround sound samples

type Buffer_Ch7

type Buffer_Ch7 [][7]float32

Buffer_Ch7 represents surround sound samples

type Sampler

type Sampler func(buf *Buffer, generate func())

Jump to

Keyboard shortcuts

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