Update examples

This commit is contained in:
Milan Nikolic 2021-11-11 16:36:32 +01:00
parent 2013bc4628
commit 7b91ce25fb
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75
8 changed files with 32 additions and 36 deletions

View file

@ -3,7 +3,7 @@ package main
import (
"math"
"github.com/gen2brain/raylib-go/raylib"
rl "github.com/gen2brain/raylib-go/raylib"
)
const (
@ -17,7 +17,7 @@ func main() {
rl.InitAudioDevice()
// Init raw audio stream (sample rate: 22050, sample size: 32bit-float, channels: 1-mono)
stream := rl.InitAudioStream(22050, 32, 1)
stream := rl.LoadAudioStream(22050, 32, 1)
//// Fill audio stream with some samples (sine wave)
data := make([]float32, maxSamples)
@ -73,7 +73,7 @@ func main() {
rl.EndDrawing()
}
rl.CloseAudioStream(stream) // Close raw audio stream and delete buffers from RAM
rl.UnloadAudioStream(stream) // Close raw audio stream and delete buffers from RAM
rl.CloseAudioDevice() // Close audio device (music streaming is automatically stopped)