Closed pro-anon closed 1 year ago
Hi @pro-anon, thanks for reporting this issue! Could you help me identify where it is stuck? Perhaps by putting some log.Println()
lines in-between the SDL2 functions. I wonder if it is stuck at the chunk.Play()
line as it is the only one without error checking.
At the beginning of the main function
func main() {
log.Println("Start main function")
...
}
Nothing gets printed.
Maybe it's an issue that happens when importing before the main function?
Hi @pro-anon, could you try running go build
instead of go run
then run the executable? I wonder if it's simply compiling for the first time which does take some time.
You're correct. After some time, it worked. Thanks!
@veeableful - it does seem to take quite a while to compile for the first time - do you know why it takes so long/is there any way to optimize this?
Hi @thatnerdjosh, it needs to compile the go-sdl2 binding first before compiling the example.
Go version: 1.20.2 linux/amd64 Go-SDL2 version: 0.4.34 SDL2 version: 2.26.5-1 OS: Linux arch 6.1.12-arch1-1 Architecture: x86_64
Steps
git clone 'https://github.com/veandco/go-sdl2-examples'
cd examples/audio_wav_memory
go mod init example
go mod tidy
go run ./audio_wav_memory.go
Expected behavior
Hearing the audio, then the program would exit.
Actual behavior
The program just freezes. Nothing happens, no audio is playing, the program doesn't exit, no errors are shown.![image](https://user-images.githubusercontent.com/97809837/232252399-f5f8911b-0241-4df4-bf4f-26cbee7b69fc.png)