Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug in _SNDOPEN (fixed in v3.14.1)
#3
Definitly not the fault of $EMBED/_EMBEDDED$, using the code below to write the embedded files back and then using "WinMerge" to compare with the originals shows, every file is correctly handled by itself, no repeats or overlaps, so it must be an issue with the sound handles/buffers.

Code: (Select All)
$EMBED:'Sound-1.MP3','SOUND1'
$EMBED:'Sound-2.MP3','SOUND2'
$EMBED:'Sound-3.MP3','SOUND3'
$EMBED:'Sound-4.MP3','SOUND4'
$EMBED:'Sound-5.MP3','SOUND5'

_WRITEFILE "Sound-11.mp3", _EMBEDDED$("SOUND1")
_WRITEFILE "Sound-22.mp3", _EMBEDDED$("SOUND2")
_WRITEFILE "Sound-33.mp3", _EMBEDDED$("SOUND3")
_WRITEFILE "Sound-44.mp3", _EMBEDDED$("SOUND4")
_WRITEFILE "Sound-55.mp3", _EMBEDDED$("SOUND5")

END

However, as it works when loading the sounds directly (see below), I suspect that especially the "MEMORY" parameter in _SNDOPEN has a glich in it.

Code: (Select All)
'DIM handles
DIM SHARED SND1&, SND2&, SND3&, SND4&, SND5&

DIM Gedaan AS INTEGER
Gedaan = 0

'LOAD the music files
SND1& = _SNDOPEN("Sound-1.MP3")
SND2& = _SNDOPEN("Sound-2.MP3")
SND3& = _SNDOPEN("Sound-3.MP3")
SND4& = _SNDOPEN("Sound-4.MP3")
SND5& = _SNDOPEN("Sound-5.MP3")

'Simple menu
DO
PRINT "1 = sound 1"
PRINT "2 = sound 2"
PRINT "3 = sound 3"
PRINT "4 = sound 4"
PRINT "5 = sound 5"
PRINT
PRINT "ESC = END"
a$ = INPUT$(1)

IF a$ = CHR$(27) THEN Gedaan = 1

IF a$ = "1" THEN
IF SND1& THEN _SNDPLAY SND1&
END IF

IF a$ = "2" THEN
IF SND2& THEN _SNDPLAY SND2&
END IF

IF a$ = "3" THEN
IF SND3& THEN _SNDPLAY SND3&
END IF

IF a$ = "4" THEN
IF SND4& THEN _SNDPLAY SND4&
END IF

IF a$ = "5" THEN
IF SND5& THEN _SNDPLAY SND5&
END IF

LOOP UNTIL Gedaan = 1

'END program
_SNDCLOSE SND1&
_SNDCLOSE SND2&
_SNDCLOSE SND3&
_SNDCLOSE SND4&
_SNDCLOSE SND5&
SYSTEM
Reply


Messages In This Thread
Bug in _SNDOPEN (fixed in v3.14.1) - by BDS107 - 08-25-2024, 03:56 PM
RE: Extended KotD #12 and #13: $EMBED and _EMBEDDED$ - by RhoSigma - 08-25-2024, 05:34 PM



Users browsing this thread: 2 Guest(s)