don't use bufio
This commit is contained in:
parent
f0cd273a5f
commit
5bba14b556
5
main.go
5
main.go
|
@ -10,7 +10,6 @@ import "github.com/veandco/go-sdl2/sdl"
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
@ -48,8 +47,6 @@ func main() {
|
||||||
|
|
||||||
bufSize := 2048
|
bufSize := 2048
|
||||||
|
|
||||||
reader := bufio.NewReaderSize(os.Stdin, bufSize)
|
|
||||||
|
|
||||||
running := true
|
running := true
|
||||||
for running {
|
for running {
|
||||||
for event := sdl.PollEvent(); event != nil; event = sdl.PollEvent() {
|
for event := sdl.PollEvent(); event != nil; event = sdl.PollEvent() {
|
||||||
|
@ -63,7 +60,7 @@ func main() {
|
||||||
|
|
||||||
audioData := make([]int16, bufSize)
|
audioData := make([]int16, bufSize)
|
||||||
|
|
||||||
err = binary.Read(reader, binary.LittleEndian, audioData)
|
err = binary.Read(os.Stdin, binary.LittleEndian, audioData)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue