bind

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package bind is for modular binding of atomix to audio interface

Package bind is for modular binding of atomix to audio interface

Package bind has native Go WAV I/O

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AudioCallback

func AudioCallback(userdata unsafe.Pointer, stream *C.Uint8, length C.int)

AudioCallback is an unsafe C++ callback function for go-sdl2

func OpenAudio

func OpenAudio(spec *AudioSpec)

OpenAudio begins streaming to the bound output audio interface, via a callback function

func SetMixNextOutput

func SetMixNextOutput(fn mixNextOutputFunc)

SetMixNextOutputFunc to stream mix output from go-atomix

func Teardown

func Teardown()

Teardown to close all hardware bindings

func UsePlayback

func UsePlayback(opt OptPlayback)

Use to select the playback interface

func UseWAV

func UseWAV(opt OptWAV)

UseWAV to select the WAV file interface

Types

type AudioFormat

type AudioFormat uint8

AudioFormat represents the bit allocation for a single sample of audio

const AudioF32LSB AudioFormat = 35

AudioF32LSB is floating-point 32-bit, least-significant-bit order

const AudioF32MSB AudioFormat = 36

AudioF32MSB is floating-point 32-bit, most-significant-bit order

const AudioS16LSB AudioFormat = 17

AudioS16LSB is integer signed 16-bit, least-significant-bit order

const AudioS16MSB AudioFormat = 19

AudioS16MSB is integer signed 16-bit, most-significant-bit order

const AudioS32LSB AudioFormat = 32

AudioS32LSB is integer signed 32-bit, least-significant-bit order

const AudioS32MSB AudioFormat = 33

AudioS32MSB is integer signed 32-bit, most-significant-bit order

const AudioS8 AudioFormat = 2

AudioS8 is integer signed 8-bit

const AudioU16LSB AudioFormat = 16

AudioU16LSB is integer unsigned 16-bit, least-significant-bit order

const AudioU16MSB AudioFormat = 18

AudioU16MSB is integer unsigned 16-bit, most-significant-bit order

const AudioU8 AudioFormat = 1

AudioU8 is integer unsigned 8-bit

type AudioSpec

type AudioSpec struct {
	Freq     int32
	Format   AudioFormat
	Channels uint16
}

AudioSpec represents the frequency, format, # channels and sample rate of any audio I/O

func LoadWAV

func LoadWAV(file string) ([][]float64, *AudioSpec)

LoadWAV into a buffer

type OptPlayback

type OptPlayback uint8

OptPlayback represents a WAV I/O option

const OptPlaybackPortAudio OptPlayback = 1

OptPlaybackPortAudio to use Go-Native WAV file I/O

const OptPlaybackSDL OptPlayback = 2

OptPlaybackSDL to use SDL for WAV file I/O

type OptWAV

type OptWAV uint8

OptWAV represents a WAV I/O option

const OptWAVGo OptWAV = 1

OptWAVGo to use Go-Native WAV file I/O

Jump to

Keyboard shortcuts

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