Example #1
0
File: sox.go Project: krig/go-sox
func NewSignalInfo(rate float64, channels, precision uint, length uint64, mult *float64) *SignalInfo {
	var s SignalInfo
	s.cSignal = &C.sox_signalinfo_t{}
	s.cSignal.rate = C.sox_rate_t(rate)
	s.cSignal.channels = C.unsigned(channels)
	s.cSignal.precision = C.unsigned(precision)
	s.cSignal.length = C.sox_uint64_t(length)
	if mult != nil {
		var d C.double
		d = C.double(*mult)
		s.cSignal.mult = &d
	}
	return &s
}
Example #2
0
File: sox.go Project: krig/go-sox
// Seek sets the location at which next samples will be decoded. Returns true if successful.
func (f *Format) Seek(offset uint64) bool {
	return C.sox_seek(f.cFormat, C.sox_uint64_t(offset), C.SOX_SEEK_SET) == C.SOX_SUCCESS
}