tta

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: LGPL-3.0 Imports: 7 Imported by: 1

README

tta

Go Report Card GoDoc Build Status Coverage Status

TTA Lossless Audio Codec Encoder/Decoder for #golang

gotta console tool

  • install: go get github.com/zyxar/tta/cmd/gotta

  • usage:

      -decode=false: decode file
      -encode=false: encode file
      -help=false: print this help
      -passwd="": specify password
    

TODOs

  • SSE4 acceleration
  • general optimization

Documentation

Index

Constants

View Source
const (

	// Version of TTA lib
	Version = "0.1.1"
)

Variables

This section is empty.

Functions

func Compress

func Compress(infile io.ReadSeeker, outfile io.ReadWriteSeeker, passwd string, cb Callback) (err error)

func Decompress

func Decompress(infile io.ReadWriteSeeker, outfile io.WriteSeeker, passwd string, cb Callback) (err error)

Types

type Callback

type Callback func(uint32, uint32, uint32)

type Decoder

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

func MakeDecoder added in v0.2.0

func MakeDecoder(iocb io.ReadWriteSeeker) *Decoder

func (*Decoder) GetInfo

func (d *Decoder) GetInfo(info *Info, pos int64) (err error)

func (*Decoder) ProcessFrame

func (d *Decoder) ProcessFrame(inSize uint32, out []byte) int32

func (*Decoder) ProcessStream

func (d *Decoder) ProcessStream(out []byte, cb Callback) int32

func (*Decoder) ReadHeader

func (d *Decoder) ReadHeader(info *Info) (uint32, error)

func (*Decoder) SetPassword

func (d *Decoder) SetPassword(pass string)

func (*Decoder) SetPosition added in v0.1.2

func (d *Decoder) SetPosition(seconds uint32) (newPos uint32, err error)

type Encoder

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

func MakeEncoder added in v0.2.0

func MakeEncoder(iocb io.ReadWriteSeeker) *Encoder

func (*Encoder) Close

func (e *Encoder) Close()

func (*Encoder) Finalize

func (e *Encoder) Finalize()

func (*Encoder) ProcessFrame

func (e *Encoder) ProcessFrame(in []byte)

func (*Encoder) ProcessStream

func (e *Encoder) ProcessStream(in []byte, cb Callback)

func (*Encoder) SetInfo

func (e *Encoder) SetInfo(info *Info) (err error)

func (*Encoder) SetPassword

func (e *Encoder) SetPassword(pass string)

func (*Encoder) WriteHeader

func (e *Encoder) WriteHeader(info *Info) (size uint32, err error)

type Info

type Info struct {
	Format  uint32 // audio format
	Nch     uint32 // number of channels
	Bps     uint32 // bits per sample
	Sps     uint32 // samplerate (sps)
	Samples uint32 // data length in samples
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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