08-11-2024, 05:46 PM
Hello
I sorry to keep bothering you guys with issues. I'm writing a game that has background music that is looping. I fade the music in and fade it out, so that it doesn't sound abrupt when starting to play or when I want it to end. So, this somewhat depends on the length of the sound clip.
So, I use _SNDLEN (handle) get the length of the sound clip. With version 3.14, _SNDLEN() no longer reports the length of a sound file that has the *.ogg extention. It returns 0 length. It has a handle and it will play it, just _SNDLEN() returns 0.
I checked with *.mp3 and they report the correct length.
Version 3.13 works correctly with either extension .
Sample code and couple of .ogg files.
I'm running Linux.
fx_drop_004.ogg (Size: 9.09 KB / Downloads: 30)
fx_question_003.ogg (Size: 10.09 KB / Downloads: 40)
I sorry to keep bothering you guys with issues. I'm writing a game that has background music that is looping. I fade the music in and fade it out, so that it doesn't sound abrupt when starting to play or when I want it to end. So, this somewhat depends on the length of the sound clip.
So, I use _SNDLEN (handle) get the length of the sound clip. With version 3.14, _SNDLEN() no longer reports the length of a sound file that has the *.ogg extention. It returns 0 length. It has a handle and it will play it, just _SNDLEN() returns 0.
I checked with *.mp3 and they report the correct length.
Version 3.13 works correctly with either extension .
Sample code and couple of .ogg files.
I'm running Linux.
Code: (Select All)
DIM AS STRING sndFile
DIM AS LONG sndH
DIM AS DOUBLE sndL
sndFile = _OPENFILEDIALOG$("Open Sound File", "", "*.mp3|*.ogg|*.wav|*.flac", "Audio files", -1)
IF sndFile <> "" THEN
sndH = _SNDOPEN(sndFile)
IF sndH > 0 THEN
_SNDVOL sndH, .25
sndL = _SNDLEN(sndH)
_SNDPLAY sndH
PRINT "File:"; sndFile
PRINT "Sound Handle:"; sndH
PRINT "Sound Length:"; sndL
END IF
END IF
END IF
fx_drop_004.ogg (Size: 9.09 KB / Downloads: 30)
fx_question_003.ogg (Size: 10.09 KB / Downloads: 40)
2D physics engine https://github.com/mechatronic3000/fzxNGN
Untitled Rouge-like https://github.com/mechatronic3000/Untitled-Rougelike
QB Pool https://github.com/mechatronic3000/QBPool
Untitled Rouge-like https://github.com/mechatronic3000/Untitled-Rougelike
QB Pool https://github.com/mechatronic3000/QBPool