Documentation ¶
Index ¶
- Constants
- type Endian
- type SoundSampleType
- type Wave
- func (snd *Wave) Channels() int
- func (snd *Wave) GetFloatAtIdx(buf *audio.IntBuffer, idx int) float32
- func (snd *Wave) Load(fn string) error
- func (snd *Wave) SampleRate() int
- func (snd *Wave) SampleSize() int
- func (snd *Wave) SampleType() SoundSampleType
- func (snd *Wave) SoundToTensor(samples *etensor.Float32, channel int) bool
- func (snd *Wave) WriteWave(fn string) error
Constants ¶
const ( BigEndian = iota // Samples are big endian byte order LittleEndian // Samples are little endian byte order )
const ( Unknown = iota // Not set SignedInt // Samples are signed integers UnSignedInt Float )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SoundSampleType ¶
type SoundSampleType int32
type Wave ¶
func (*Wave) GetFloatAtIdx ¶
GetFloatAtIdx
func (*Wave) SampleRate ¶
SampleRate returns the sample rate of the sound or 0 is snd is nil
func (*Wave) SampleSize ¶
SampleSize returns the sample rate of the sound or 0 is snd is nil
func (*Wave) SampleType ¶
func (snd *Wave) SampleType() SoundSampleType
todo: return to this SampleType
func (*Wave) SoundToTensor ¶
SoundToTensor converts sound data to floating point etensor with normalized -1..1 values (unless sound is stored as a float natively, in which case it is not guaranteed to be normalized) -- for use in signal processing routines -- can optionally select a specific channel (formats sound_data as a single-dimensional matrix of frames size), and -1 gets all available channels (formats sound_data as two-dimensional matrix with outer dimension as channels and inner dimension frames