Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
heres another one
#1
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??
o live is to die, to die is to expel, to expel is to exist is to live without knowing to be
Reply
#2
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??
I'd knock on wood, but my desk is particle board.
Reply
#3
sure does it can fmod can only play .mid and .mod files check it out
o live is to die, to die is to expel, to expel is to exist is to live without knowing to be
Reply
#4
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.
I'd knock on wood, but my desk is particle board.
Reply
#5
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
o live is to die, to die is to expel, to expel is to exist is to live without knowing to be
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)