set buffer size for reader
This commit is contained in:
parent
15d3f6200f
commit
f0cd273a5f
6
main.go
6
main.go
|
@ -46,7 +46,9 @@ 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)
|
||||||
|
|
||||||
reader := bufio.NewReader(os.Stdin)
|
bufSize := 2048
|
||||||
|
|
||||||
|
reader := bufio.NewReaderSize(os.Stdin, bufSize)
|
||||||
|
|
||||||
running := true
|
running := true
|
||||||
for running {
|
for running {
|
||||||
|
@ -59,7 +61,7 @@ func main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
audioData := make([]int16, 2048)
|
audioData := make([]int16, bufSize)
|
||||||
|
|
||||||
err = binary.Read(reader, binary.LittleEndian, audioData)
|
err = binary.Read(reader, binary.LittleEndian, audioData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue