voc

package
v0.0.0-...-a4aebfb Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: BSD-3-Clause, BSD-3-Clause Imports: 4 Imported by: 0

README

Originally from https://github.com/inkyblackness/res/tree/master/audio/voc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(writer io.Writer, sampleRate float32, samples []byte)

Save encodes the provided samples into the given writer

Types

type Codec

type Codec int
const (
	CodecU8            Codec = 0x0
	Codec4_to_8_ADPCM  Codec = 0x1
	Codec3_to_8_ADPCM  Codec = 0x2
	Codec2_to_8_ADPCM  Codec = 0x3
	CodecS16PCM        Codec = 0x4
	CodecALaw          Codec = 0x6
	CodecULaw          Codec = 0x7
	Codec4_to_16_ADPCM Codec = 0x200
)

type L8SoundData

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

L8SoundData is a in-memory sound buffer.

func Load

func Load(source io.Reader) (*L8SoundData, error)

Load reads from the provided source a Creative Voice Sound and returns the data.

func NewL8SoundData

func NewL8SoundData(sampleRate float32, samples []byte) *L8SoundData

NewL8SoundData returns a new sound data instance with the given data.

func (*L8SoundData) AllSamples

func (data *L8SoundData) AllSamples() []byte

func (*L8SoundData) SampleCount

func (data *L8SoundData) SampleCount() int

SampleCount returns the count of samples available in this data.

func (*L8SoundData) SampleRate

func (data *L8SoundData) SampleRate() float32

SampleRate returns the amount of samples for one second.

func (*L8SoundData) Samples

func (data *L8SoundData) Samples(from, to int) []byte

Samples returns the samples in the given range

Jump to

Keyboard shortcuts

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