Documentation
¶
Index ¶
- func AttenuateFloatBuffer(mixTrack *audio.FloatBuffer, numTracks, bufferSize int)
- func FXFloatBuffers(tracks []*TrackInfo, fx []*TrackFX)
- func GetPCMRange(bitDepth int) (max, min, ref float64)
- func Mix(mixTrack *audio.FloatBuffer, sourceTracks []*TrackInfo, fx []*TrackFX, ...) (mixBufferSize int)
- func MixWavDecoders(wavDecs []*wav.Decoder, wavOut *os.File, fx []*TrackFX, bitDepth int, ...) error
- func MixWavFiles(files []*string, outWavName *string, fx []*TrackFX, bitDepth int, ...) error
- func ReadWavsToBuffers(wavDecs []*wav.Decoder, tracks []*TrackInfo) (mixBufferSize int)
- func ScaleFloatBuffers(tracks []*TrackInfo, bitDepth int)
- func SumFloatBuffers(mixTrack *audio.FloatBuffer, sourceTracks []*TrackInfo) (mixBufferSize int)
- type TrackFX
- type TrackInfo
- type TrackStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttenuateFloatBuffer ¶
func AttenuateFloatBuffer(mixTrack *audio.FloatBuffer, numTracks, bufferSize int)
Function to attenuate linearly to prevent clipping in real-time without knowing/using true peak, RMS, LUFS, etc.
func GetPCMRange ¶
func Mix ¶
func Mix(mixTrack *audio.FloatBuffer, sourceTracks []*TrackInfo, fx []*TrackFX, bitDepth int, attenuate bool, stats []*TrackStats) (mixBufferSize int)
Function to mix TrackInfo float buffers to a provided mix float buffer, performing FX, scaling, and attenuation operations as needed, and return length of longest buffer
func MixWavDecoders ¶
func MixWavDecoders(wavDecs []*wav.Decoder, wavOut *os.File, fx []*TrackFX, bitDepth int, attenuate bool, stats []*TrackStats, bufferCap int) error
Function to mix wav decoders and write mix to output
func MixWavFiles ¶
func MixWavFiles(files []*string, outWavName *string, fx []*TrackFX, bitDepth int, attenuate bool, stats []*TrackStats, bufferCap int) error
Function to mix wav files and write mix to output
func ReadWavsToBuffers ¶
Function to read PCM data from a wav decoder into a TrackInfo's buffers, set bufferSize, and return length of longest buffer
func ScaleFloatBuffers ¶
Function to scale input bit depth to output bit depth
func SumFloatBuffers ¶
func SumFloatBuffers(mixTrack *audio.FloatBuffer, sourceTracks []*TrackInfo) (mixBufferSize int)
Function to sum TrackInfo float buffers to a mix float buffer and return buffer size of mix, equal to length of longest buffer