ninjamencoder

package module
v0.0.0-...-9617227 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2019 License: GPL-3.0 Imports: 5 Imported by: 1

README

NINJAM Interval Encoder in Go

This is a library that can be used to encode audio data into NINJAM audio chunks.

Getting Started

If you don't know why you're here, you probably don't need this.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeinterleaveSamples

func DeinterleaveSamples(samples []float32, channelCount int) ([][]float32, error)

DeinterleaveSamples deinterleaves samples (duh!)

func DeinterleaveSamplesInPlace

func DeinterleaveSamplesInPlace(samples []float32, buf [][]float32) error

DeinterleaveSamplesInPlace will deinterleave samples into an already provided buffer

func InterleaveSamples

func InterleaveSamples(samples [][]float32) ([]float32, error)

InterleaveSamples interleaves samples (you don't say?!)

func InterleaveSamplesInPlace

func InterleaveSamplesInPlace(samples [][]float32, buf []float32) error

InterleaveSamplesInPlace interleaves samples into an already provided buffer

func SetLogLevel

func SetLogLevel(level logrus.Level)

SetLogLevel sets logrus log level

Types

type Encoder

type Encoder struct {
	ChannelCount int     // number of audio channels to encode
	SampleRate   int     // audio sample rate
	ChunkSize    int     // number of frames in a single packet
	Quality      float32 // vorbis encoder quality
	// contains filtered or unexported fields
}

Encoder parameters to use for vorbis encoder.

func NewEncoder

func NewEncoder() *Encoder

NewEncoder creates a new Encoder struct with sensible default values: stereo 44.1kHz, chunk size set to 8K frames, quality set to 0.1

func (*Encoder) EncodeNinjamInterval

func (encoder *Encoder) EncodeNinjamInterval(samples [][]float32) ([][]byte, error)

EncodeNinjamInterval will accept deinterleaved samples. Returns an array of arrays of bytes, one array per each packet generated.

Jump to

Keyboard shortcuts

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