(02-19-2023, 04:25 PM)Petr Wrote: Hello. I found a MemSound bug (see attached test program) that makes Phoenix 3.5.0 MemSound unable to be used properly and causing my programs to crash, unlike QB64 2.02. The attached program exactly shows the occurrence of the error.
Code: (Select All)$NoPrefix
s = SndOpen("0.mp3")
Dim As MEM l, r
l = MemSound(s, 1)
r = MemSound(s, 2)
Print "MemSound bug"
Print "Value returned for left audio channel:"; l.SIZE
Print "Value returned for right audio channel:"; r.SIZE
chan& = SndLen(s) * 2 * SndRate
If l.SIZE = r.SIZE And r.SIZE = chan& Then Print "All ok!": End
Print "the size of the ONE audio track channel, that is expected:"; chan&
Print "Value returned with SndOpen:"; s;
If s > 0 Then Print "[correct audio file]" Else Print "[unsupported audio file]"
Print "press key for try play this file"
Sleep
SndPlay s
If SndPlaying(s) Then Print "Both channels playing, bug is not in SndOpen." Else Print "Bug is in SndOpen"
'wroted in Phoenix IDE 3.5.0
This is working for me @Petr.
However, there has been a slight change in the behavior of _MemSound since we moved to the miniaudio backend. The wiki link has all the details and new examples. But to put this briefly, line "r.SIZE" will always return 0 since miniaudio internally uses interleaved audio for multi-channel sounds. Hence, the "All ok!" text will never print.