use array
This commit is contained in:
parent
c715f42c71
commit
b67aae3289
8
main.go
8
main.go
|
@ -49,7 +49,7 @@ func main() {
|
||||||
preset := C.CString("/usr/share/projectM/presets/presets_stock/Zylot - Wisps.milk")
|
preset := C.CString("/usr/share/projectM/presets/presets_stock/Zylot - Wisps.milk")
|
||||||
C.projectm_load_preset_file(handle, preset, false)
|
C.projectm_load_preset_file(handle, preset, false)
|
||||||
|
|
||||||
bufSize := 2048
|
const bufSize int = 2048
|
||||||
|
|
||||||
running := true
|
running := true
|
||||||
for running {
|
for running {
|
||||||
|
@ -61,9 +61,9 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
audioData := make([]int16, bufSize)
|
var audioData [bufSize]int16
|
||||||
|
|
||||||
err = binary.Read(os.Stdin, binary.LittleEndian, audioData)
|
err = binary.Read(os.Stdin, binary.LittleEndian, &audioData)
|
||||||
if err == io.ErrUnexpectedEOF {
|
if err == io.ErrUnexpectedEOF {
|
||||||
running = false
|
running = false
|
||||||
break
|
break
|
||||||
|
@ -71,7 +71,7 @@ func main() {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
C.projectm_pcm_add_int16(handle, (*C.int16_t)(&audioData[0]), C.uint(len(audioData)), C.PROJECTM_STEREO)
|
C.projectm_pcm_add_int16(handle, (*C.int16_t)(&audioData[0]), C.uint(bufSize), C.PROJECTM_STEREO)
|
||||||
|
|
||||||
C.projectm_opengl_render_frame(handle)
|
C.projectm_opengl_render_frame(handle)
|
||||||
window.GLSwap()
|
window.GLSwap()
|
||||||
|
|
Loading…
Reference in New Issue