Exemplo n.º 1
0
// Vfix16_byte converts an array of single-precision floating-point values to signed 16-bit integer values, rounding towards zero. Output to a byte stream.
func Vfix16_byte(input []float32, inputStride int, output []byte, outputStride int) {
	C.vDSP_vfix16((*C.float)(&input[0]), C.vDSP_Stride(inputStride), (*C.short)(unsafe.Pointer(&output[0])), C.vDSP_Stride(outputStride), C.vDSP_Length(len(output)/2/outputStride))
}
Exemplo n.º 2
0
// Vfix16 converts an array of single-precision floating-point values to signed 16-bit integer values, rounding towards zero.
func Vfix16(input []float32, inputStride int, output []int16, outputStride int) {
	C.vDSP_vfix16((*C.float)(&input[0]), C.vDSP_Stride(inputStride), (*C.short)(&output[0]), C.vDSP_Stride(outputStride), minLen(len(input)/inputStride, len(output)/outputStride))
}