Qbasicnews.com

Full Version: heres another one
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
as copied from fmodtest
Code:
Const MusicFile = "dne_trtn.mod"
    Dim Shared Handle As Long


    If FSOUND_GetVersion <= FMOD_VERSION Then
          ErrorQuit "FMOD version " + STR$(FMOD_VERSION) + " or greater required"
    End If

    If FSOUND_Init(44100, 32, 0) = FALSE Then
          ErrorQuit "Can't initialize FMOD"
    End If

    Handle = FMUSIC_LoadSong(MusicFile)
    If Handle = FALSE Then
          ErrorQuit "Can't load music file " + CHR$(34) + MusicFile + CHR$(34)
    End if

    FMUSIC_PlaySong(Handle)

    Print "FMOD test for freeBASIC"
    Print
    Print "(press any key to quit)"

    Sleep

    FMUSIC_FreeSong(Handle)
    FSOUND_Close

    End

ok in my program i have this i know its not right but how do i fix this

if lev=1 then Const MusicFile = "l1.mid"
if lev=2 then const musicfile="l2.mid"

i get the error message duplicated definition musicfile
i know that it being a const its saying that there can only be one definition even though its within the if statement so how do i get it to accept both when lev=1 i want it to play l1.mid and when lev=2 play l2.mid??
Two problems:

1. Constants can only be used once per label. Use a variable instead.
2. Last time I checked...FMOD doesn't support MIDI. Wtf? Did I miss something??
sure does it can fmod can only play .mid and .mod files check it out
It plays more module formats than .mod...it can also play .s3m .it and .xm, not sure about others. But when did it get MIDI support? This is news.
not sure but it was just today that i finaly figured out how to add music to my programs and was playing around and stumbled onto it but either way it's cool