vadpcm

package
v0.0.0-...-912d621 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package vadpcm provides tools for working with VADPCM-encoded audio.

Index

Constants

View Source
const CompressionName = "VADPCM ~4-1"

CompressionName is the descriptive name used to represent VADPCM compression.

View Source
const CompressionType = "VAPC"

CompressionType is the four-character code used to represent VADPCM compression.

View Source
const EncodeOrder = C.kVADPCMEncodeOrder

EncodeOrder is the predictor order when encoding. Other values are not supported. Do not change this value.

View Source
const FrameByteSize = C.kVADPCMFrameByteSize

FrameByteSize is the number of bytes in an encoded VADPCM frame.

View Source
const FrameSampleCount = C.kVADPCMFrameSampleCount

FrameSampleCount is the number of samples in a VADPCM frame.

View Source
const MaxOrder = C.kVADPCMMaxOrder

MaxOrder maximum supported predictor order. Do not change this value. This is chosen to make the decoder state the same size as a 128-bit vector.

View Source
const MaxPredictorCount = C.kVADPCMMaxPredictorCount

MaxPredictorCount is the maximum supported number of predictors. This is limited by the format of VADPCM frames, which only use four bits to encode the predictor index.

View Source
const VectorSize = 8

VectorSize is the number of elements in a VADPCM vector.

Variables

This section is empty.

Functions

func Decode

func Decode(codebook *Codebook, state *Vector, dest []int16, src []byte) (int, error)

Decode decodes VADPCM-encoded audio data. Returns the number of frames decoded.

Types

type Codebook

type Codebook struct {
	Order          int
	PredictorCount int
	Vectors        []Vector
}

func Encode

func Encode(params *Parameters, data []int16) (*Codebook, []byte, error)

Encode encodes audio as VADPCM.

type Parameters

type Parameters struct {
	PredictorCount int
}

Parameters contains the parameters for encoding,

type Vector

type Vector [VectorSize]int16

Jump to

Keyboard shortcuts

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