示例#1
0
文件: vorbis.go 项目: xlab/vorbis-go
// AnalysisBuffer function as declared in https://xiph.org/vorbis/doc/libvorbis/vorbis_analysis_buffer.html
func AnalysisBuffer(v *DspState, vals int32) **float32 {
	cv, _ := v.PassRef()
	cvals, _ := (C.int)(vals), cgoAllocsUnknown
	__ret := C.vorbis_analysis_buffer(cv, cvals)
	__v := *(***float32)(unsafe.Pointer(&__ret))
	return __v
}
示例#2
0
文件: vorbis.go 项目: grd/vorbis
func AnalysisBuffer(v *DspState, vals int) [][]float32 {
	floatpp := C.vorbis_analysis_buffer((*C.vorbis_dsp_state)(v), C.int(vals))
	ret := make([][]float32, 2)
	for i := 0; i < 2; i++ {
		indx := C.vorbis_get_buffer_indx(floatpp, C.int(i))
		h := &reflect.SliceHeader{uintptr(unsafe.Pointer(indx)), vals, vals}
		ret[i] = *(*[]float32)(unsafe.Pointer(h))
	}
	return ret
}