miniaudio

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Miniaudio

type Miniaudio struct {
	streams.Streamable

	Format malgo.FormatType // Default malgo.FormatS16

	// If defined each packet is Compressed / Decompressed.
	Compressor streams.Compressor
	// contains filtered or unexported fields
}

Miniaudio Streamable support. Source: Miniaudio(https://miniaud.io) "Miniaudio is an audio playback and capture library for C and C++. It's made up of a single source file, has no external dependencies and is released into the public domain." We use the embedded go bindings malgo(https://github.com/gen2brain/malgo)

+---------------+----------------------------------------+---------------------------+
| ma_format_f32 | 32-bit floating point                  | [-1, 1]                   |
| ma_format_s16 | 16-bit signed integer                  | [-32768, 32767]           |
| ma_format_s24 | 24-bit signed integer (tightly packed) | [-8388608, 8388607]       |
| ma_format_s32 | 32-bit signed integer                  | [-2147483648, 2147483647] |
| ma_format_u8  | 8-bit unsigned integer                 | [0, 255]                  |
+---------------+----------------------------------------+---------------------------+

func (*Miniaudio) Address

func (p *Miniaudio) Address() string

Address correspond to the <IP or Name:PORT>

func (*Miniaudio) Configure

func (p *Miniaudio) Configure(address string, sampleRate float64, nbChannels int, echo bool, done chan interface{})

func (*Miniaudio) Done

func (p *Miniaudio) Done() chan interface{}

Done is the cancellation channel

func (*Miniaudio) Echo

func (p *Miniaudio) Echo() bool

Echo if responding true prints the flow in the stdio

func (*Miniaudio) NbChannels

func (p *Miniaudio) NbChannels() int

NbChannels stereo = 2

func (*Miniaudio) Play

func (p *Miniaudio) Play(access string, echo bool) error

Play a local or distant mp3 and wave files to test the audio layer.

func (*Miniaudio) ReadStreamFrom

func (p *Miniaudio) ReadStreamFrom(c io.Reader) error

ReadStreamFrom receive the stream plays the audio via miniaudio.

func (*Miniaudio) SampleRate

func (p *Miniaudio) SampleRate() float64

SampleRate is the sample rate :)

func (*Miniaudio) WriteStreamTo

func (p *Miniaudio) WriteStreamTo(c io.Writer) error

WriteStreamTo captures the audio in using miniaudio. then send them to the stream.

Jump to

Keyboard shortcuts

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