Move audio structs

This commit is contained in:
Milan Nikolic 2023-11-12 17:51:38 +01:00
parent 61a393d4ce
commit 3d34b7e25a
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75
2 changed files with 121 additions and 33 deletions

View file

@ -74,39 +74,6 @@ func newMusicFromPointer(ptr unsafe.Pointer) Music {
return *(*Music)(ptr)
}
// Sound source type
type Sound struct {
Stream AudioStream
FrameCount uint32
_ [4]byte
}
// Music type (file streaming from memory)
// NOTE: Anything longer than ~10 seconds should be streamed
type Music struct {
Stream AudioStream
FrameCount uint32
Looping bool
CtxType int32
CtxData unsafe.Pointer
}
// AudioStream type
// NOTE: Useful to create custom audio streams not bound to a specific file
type AudioStream struct {
// Buffer
Buffer *C.rAudioBuffer
// Processor
Processor *C.rAudioProcessor
// Frequency (samples per second)
SampleRate uint32
// Bit depth (bits per sample): 8, 16, 32 (24 not supported)
SampleSize uint32
// Number of channels (1-mono, 2-stereo)
Channels uint32
_ [4]byte
}
// InitAudioDevice - Initialize audio device and context
func InitAudioDevice() {
C.InitAudioDevice()