set buffer size for reader

This commit is contained in:
filifa 2024-08-22 22:44:12 -05:00
parent 15d3f6200f
commit f0cd273a5f
1 changed files with 4 additions and 2 deletions

View File

@ -46,7 +46,9 @@ func main() {
preset := C.CString("/usr/share/projectM/presets/presets_stock/Zylot - Wisps.milk")
C.projectm_load_preset_file(handle, preset, false)
reader := bufio.NewReader(os.Stdin)
bufSize := 2048
reader := bufio.NewReaderSize(os.Stdin, bufSize)
running := true
for running {
@ -59,7 +61,7 @@ func main() {
}
}
audioData := make([]int16, 2048)
audioData := make([]int16, bufSize)
err = binary.Read(reader, binary.LittleEndian, audioData)
if err != nil {