winmm

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: Unlicense Imports: 4 Imported by: 0

README

go-winmm

WinMM (Win32) support for Go

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	// WAVERR_STILLPLAYING defines a value equal to the WAVERR_STILLPLAYING error code from winmm api
	WAVERR_STILLPLAYING = uintptr(33)

	// WAVE_FORMAT_PCM specifies PCM wave format
	WAVE_FORMAT_PCM = uint16(0x0001)

	// WAVE_MAPPER specifies the system default configured wave device
	WAVE_MAPPER = uint32(0xFFFFFFFF)
)

Variables

View Source
var (
	// ErrWinMM is for tagging Windows Multimedia errors appropriately
	ErrWinMM = errors.New("winmm error")
)

Functions

This section is empty.

Types

type HWAVEOUT

type HWAVEOUT windows.Handle

HWAVEOUT is a handle for a WAVEOUT device

type WAVEFORMATEX

type WAVEFORMATEX struct {
	WFormatTag      uint16
	NChannels       uint16
	NSamplesPerSec  uint32
	NAvgBytesPerSec uint32
	NBlockAlign     uint16
	WBitsPerSample  uint16
	CbSize          uint16
}

WAVEFORMATEX is a structure containing data about a wave format

type WAVEHDR

type WAVEHDR struct {
	LpData          uintptr
	DwBufferLength  uint32
	DwBytesRecorded uint32
	DwUser          uintptr
	DwFlags         uint32
	DwLoops         uint32
	LpNext          uintptr
	Reserved        uintptr
}

WAVEHDR is a structure containing the details about a circular buffer of wave data

type WaveOut

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

WaveOut is a sound device for the windows multimedia system

func New

func New(channels int, samplesPerSec int, bitsPerSample int) (*WaveOut, error)

New creates a new WaveOut device based on the parameters provided

func (*WaveOut) Close

func (w *WaveOut) Close()

Close terminates a WaveOut device

func (*WaveOut) IsHeaderFinished

func (w *WaveOut) IsHeaderFinished(hdr *WaveOutData) bool

IsHeaderFinished determines if a wave output buffer has finished playing and will readd it to the available buffer queue when it is

func (*WaveOut) Write

func (w *WaveOut) Write(data []byte) *WaveOutData

Write prepares a byte array for output to the WaveOut device

type WaveOutData

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

WaveOutData is a structure holding the header and the go version of the data sent out to the sound device (for garbage collection reasons)

Jump to

Keyboard shortcuts

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