RetroBASIC
Retrogamecoding(.org) => EGSL => Topic started by: kolyamatic on March 05, 2013, 04:32:32 PM
-
On my journey through EGSL, I was now about to add music/sound.
I know the possible file formats for images (see docu), but are there limitations on music/sound regarding the format?
If so, which are supported?
If not so, how do I load a .midi?
-
MIDI files are supported but only as music, not as sounds. So do a:
mymusic = loadmusic ("mymidi.midi")
playmusic (mymusic, 100, -1)
The second paramter of playmusic is the volume, the third the loop. Use -1 for looping forever. Use 0 to play it once, 1 to play it twice ...
-
Well, I looked it up in the docu and wrote some kind which was nearly 1:1 yours. (I added "local" before the variable, is that a mistake in this case?)
But there was one difference though: I had a path including two additional folders - and I got the "Can not open music/sound file." error. So I guess it might be that?
Looking forward for future responses.
-
Please post your code for further help.
-
openwindow(640,480,32,"GoF")
local AmparoRoca = loadmusic("data/music/AmparoRoca.midi")
playmusic(AmparoRoca,100,0)
inkey()
closewindow()
I triple-checked possible spelling mistakes with the file's name. The path does also exist.
Furthermore I tried leaving out the "local" - no changes.
-
Is it really ".midi"? My midi files have only ".mid" as an extension.
-
It says .midi, yes.
Though I tried with .mid - and it works. And it is so loud... but I think that's the fault of my computer/headset/ears.
Anyway, thanks for the help.