foxWavReader

package module
v0.0.0-...-31770e3 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package: github.com/Foxenfurter/foxAudioLib/foxAudioDecoder/foxWavReader file foxWavReader.go pkg for encoding a stream into wav format. The package has been specified to allow a header to be written in the initial phase the body to be following this. The package is expected to be called as part of an encoder function. which will run asynchronously

Index

Constants

This section is empty.

Variables

View Source
var (
	AMBISONIC_B_FORMAT_PCMPCMguid        = NewWaveFormatExString("e8f32218-3fc1-4361-9f41-abf9b3b72260")
	AMBISONIC_B_FORMAT_IEEE_FLOATPCMguid = NewWaveFormatExString("00000003-0721-11d3-8644-C8C1CA000000")
)

Functions

This section is empty.

Types

type WavReader

type WavReader struct {
	SampleRate   int
	BitDepth     int
	NumChannels  int
	Size         uint32
	ReaderCursor int
	LittleEndian bool
	ByteOrder    binary.ByteOrder

	Input       io.Reader // Changed from *os.File to io.Reader
	AudioFormat WaveFormat
	DebugFunc   func(string)
	// contains filtered or unexported fields
}

Structure holds basic information about the Samples to be encoded this is a type neutral representation of the WavHeader structure

func (*WavReader) ConvertBytesToFloat64

func (FD *WavReader) ConvertBytesToFloat64(myBytes []byte) ([][]float64, error)

Byte Converter

func (*WavReader) DecodeInput

func (FD *WavReader) DecodeInput(DecodedSamplesChannel chan [][]float64) error

Function shoudl resume reading the input stream and pass the resulting samples to the output Channel

func (*WavReader) DecodeWavHeader

func (fd *WavReader) DecodeWavHeader() error

Read Wav File Header

func (*WavReader) GetBitDepth

func (fd *WavReader) GetBitDepth() int

GetBitDepth returns the bit depth of the FoxDecoder.

func (*WavReader) GetLittleEndian

func (fd *WavReader) GetLittleEndian() bool

SetEndianess sets the Endianess field of FoxDecoder.

func (*WavReader) GetNumChannels

func (fd *WavReader) GetNumChannels() int

GetNumChannels returns the number of channels in the FoxDecoder.

func (*WavReader) GetReaderCursor

func (fd *WavReader) GetReaderCursor() int

GetReaderCursor returns the reader cursor position of the FoxDecoder.

func (*WavReader) GetSampleRate

func (fd *WavReader) GetSampleRate() int
Getters and Setters

------------Getters---------------------------------------- GetSampleRate returns the sample rate of the FoxDecoder.

func (*WavReader) GetSize

func (fd *WavReader) GetSize() uint32

GetSize returns the size of the FoxDecoder.

func (*WavReader) SetBitDepth

func (fd *WavReader) SetBitDepth(bitDepth int)

SetBitDepth sets the BitDepth field of FoxDecoder.

func (*WavReader) SetLittleEndian

func (fd *WavReader) SetLittleEndian(endianNess bool)

SetEndianess sets the Endianess field of FoxDecoder.

func (*WavReader) SetNumChannels

func (fd *WavReader) SetNumChannels(numChannels int)

SetNumChannels sets the NumChannels field of FoxDecoder.

func (*WavReader) SetReaderCursor

func (fd *WavReader) SetReaderCursor(readerCursor int)

SetReaderCursor sets the ReaderCursor field of FoxDecoder.

func (*WavReader) SetSampleRate

func (fd *WavReader) SetSampleRate(sampleRate int)

--------------Setters-------------------------------- SetSampleRate sets the SampleRate field of FoxDecoder.

func (*WavReader) SetSize

func (fd *WavReader) SetSize(size uint32)

SetSize sets the Size field of FoxDecoder.

type WaveFile

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

Holds detailed information about the wav Header

type WaveFormat

type WaveFormat uint16
const (
	PCM             WaveFormat = 1
	ADPCM           WaveFormat = 2
	IEEE_FLOAT      WaveFormat = 3
	INTERNAL_DOUBLE WaveFormat = 4
	EXTENSIBLE      WaveFormat = 0xFFFE
)

type WaveFormatEx

type WaveFormatEx struct {
	GUID [16]byte
}

func NewWaveFormatExBytes

func NewWaveFormatExBytes(guid []byte) WaveFormatEx

NewWaveFormatExBytes creates a new WaveFormatEx instance with the specified GUID byte array.

func NewWaveFormatExString

func NewWaveFormatExString(guid string) WaveFormatEx

NewWaveFormatExString creates a new WaveFormatEx instance with the specified GUID string.

func (*WaveFormatEx) Equals

func (wf *WaveFormatEx) Equals(other *WaveFormatEx) bool

func (*WaveFormatEx) GetHashCode

func (wf *WaveFormatEx) GetHashCode() int

func (*WaveFormatEx) String

func (wf *WaveFormatEx) String() string

Jump to

Keyboard shortcuts

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