tinyapi

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PCM_FORMAT_INVALID = iota - 1
	/** Signed 16-bit, little endian */
	PCM_FORMAT_S16_LE
	/** Signed, 32-bit, little endian */
	PCM_FORMAT_S32_LE
	/** Signed, 8-bit */
	PCM_FORMAT_S8
	/** Signed, 24-bit (32-bit in memory), little endian */
	PCM_FORMAT_S24_LE
	/** Signed, 24-bit, little endian */
	PCM_FORMAT_S24_3LE

	/** Signed, 16-bit, big endian */
	PCM_FORMAT_S16_BE
	/** Signed, 24-bit (32-bit in memory), big endian */
	PCM_FORMAT_S24_BE
	/** Signed, 24-bit, big endian */
	PCM_FORMAT_S24_3BE
	/** Signed, 32-bit, big endian */
	PCM_FORMAT_S32_BE
	/** 32-bit float, little endian */
	PCM_FORMAT_FLOAT_LE
	/** 32-bit float, big endian */
	PCM_FORMAT_FLOAT_BE
	/** Max of the enumeration list, not an actual format. */
	PCM_FORMAT_MAX
)
View Source
const PCM_IN = C.PCM_IN
View Source
const PCM_OUT = C.PCM_OUT

Variables

View Source
var Formats = map[int]string{
	0:  "S8",
	1:  "U8",
	2:  "S16_LE",
	3:  "S16_BE",
	4:  "U16_LE",
	5:  "U16_BE",
	6:  "S24_LE",
	7:  "S24_BE",
	8:  "U24_LE",
	9:  "U24_BE",
	10: "S32_LE",
	11: "S32_BE",
	12: "U32_LE",
	13: "U32_BE",
	14: "FLOAT_LE",
	15: "FLOAT_BE",
	16: "FLOAT64_LE",
	17: "FLOAT64_BE",
	18: "IEC958_SUBFRAME_LE",
	19: "IEC958_SUBFRAME_BE",
	20: "MU_LAW",
	21: "A_LAW",
	22: "IMA_ADPCM",
	23: "MPEG",
	24: "GSM",

	31: "SPECIAL",
	32: "S24_3LE",
	33: "S24_3BE",
	34: "U24_3LE",
	35: "U24_3BE",
	36: "S20_3LE",
	37: "S20_3BE",
	38: "U20_3LE",
	39: "U20_3BE",
	40: "S18_3LE",
	41: "S18_3BE",
	42: "U18_3LE",
	43: "U18_3BE",
}

Functions

func GetParams

func GetParams(cardNr int, deviceNr int) (pcm.Info, pcm.Info)

Types

type PcmDevice

type PcmDevice struct {
	Config pcm.Config
	// contains filtered or unexported fields
}

func PcmOpen

func PcmOpen(cardNr int, deviceNr int, openFlags int, config pcm.Config) (PcmDevice, error)

func (*PcmDevice) BitsPerSample

func (d *PcmDevice) BitsPerSample() uint16

func (*PcmDevice) BytesPerFrame

func (d *PcmDevice) BytesPerFrame() int

func (*PcmDevice) Close

func (d *PcmDevice) Close()

func (*PcmDevice) FrameBytesSize

func (d *PcmDevice) FrameBytesSize() int

func (*PcmDevice) GetError

func (d *PcmDevice) GetError() error

func (*PcmDevice) IsReady

func (d *PcmDevice) IsReady() bool

func (*PcmDevice) ReadFrames

func (d *PcmDevice) ReadFrames(buffer []byte, size int) error

func (*PcmDevice) WaitUntilReady added in v1.0.1

func (d *PcmDevice) WaitUntilReady(timeout time.Duration) error

func (*PcmDevice) WriteFrames

func (d *PcmDevice) WriteFrames(buffer []byte, size int) error

Jump to

Keyboard shortcuts

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