Loading ...
Sorry, an error occurred while loading the content.

Can You play MP3 files in the background of games...?

Expand Messages
  • Timothy Francis Sullivan
    Hi Guys, Mt name is tim and the past month i have been building a game called DIE!-kind of like grand theft auto but i would like to play mp3 music files-is it
    Message 1 of 7 , Nov 30, 2006
    • 0 Attachment
      Hi Guys,

      Mt name is tim and the past month i have been building a game called
      DIE!-kind of like grand theft auto but i would like to play mp3 music
      files-is it possible that i can do that?

      Thanks
      Tim.
    • Taz
      HI im taz there is a way to do this. i cant remeerb off the top of my head how to but there are many games out there which do. u need to have all the mp3 files
      Message 2 of 7 , Dec 5, 2006
      • 0 Attachment
        HI im taz there is a way to do this. i cant remeerb off the top of my
        head how to but there are many games out there which do.
        u need to have all the mp3 files in a single folder. ill get back to
        you as i cant remeber, whats the game like? :) sounds good

        taz
        --- In libertybasic@yahoogroups.com, "Timothy Francis Sullivan"
        <timaaarrreee@...> wrote:
        >
        > Hi Guys,
        >
        > Mt name is tim and the past month i have been building a game called
        > DIE!-kind of like grand theft auto but i would like to play mp3
        music
        > files-is it possible that i can do that?
        >
        > Thanks
        > Tim.
        >
      • rod_bird001
        ... my ... to ... called ... Check this link http://www.freewebs.com/lb-connection/features.htm and this http://www.alycesrestaurant.com/companion.htm Both
        Message 3 of 7 , Dec 6, 2006
        • 0 Attachment
          --- In libertybasic@yahoogroups.com, "Taz" <spaztaz666@...> wrote:
          >
          > HI im taz there is a way to do this. i cant remeerb off the top of
          my
          > head how to but there are many games out there which do.
          > u need to have all the mp3 files in a single folder. ill get back
          to
          > you as i cant remeber, whats the game like? :) sounds good
          >
          > taz
          > --- In libertybasic@yahoogroups.com, "Timothy Francis Sullivan"
          > <timaaarrreee@> wrote:
          > >
          > > Hi Guys,
          > >
          > > Mt name is tim and the past month i have been building a game
          called
          > > DIE!-kind of like grand theft auto but i would like to play mp3
          > music
          > > files-is it possible that i can do that?
          > >
          > > Thanks
          > > Tim.
          > >
          >
          Check this link http://www.freewebs.com/lb-connection/features.htm
          and this http://www.alycesrestaurant.com/companion.htm Both show/
          allow mp3 playing via API/DLL Consider also converting the sample
          to a .wav format. Liberty can only play one sound at a time this
          http://webzoom.freewebs.com/gamebin/Other%20Software/MultiWav.ZIP
          shows how to use wavemix.dll to play multiple sounds. You can also
          play a .mid file in the background with playmidi and then
          various .wav files over the top with playwav but only one .wav at a
          time. Loads of ways to do what you want.
        • gordon sweer
          The program Hockey.bas supplied with LB does this. If you look as LB News Letters 128 and 129 you will see how I also acieved theis whil didpalying Patters or
          Message 4 of 7 , Dec 7, 2006
          • 0 Attachment
            The program Hockey.bas supplied with LB does this. If
            you look as LB News Letters 128 and 129 you will see
            how I also acieved theis whil didpalying Patters or
            Clipart.

            Gordon S.



            ___________________________________________________________
            Inbox full of spam? Get leading spam protection and 1GB storage with All New Yahoo! Mail. http://uk.docs.yahoo.com/nowyoucan.html
          • rod_bird001
            ... Actually Gordon it plays a .mid file, this thread discusses .mp3
            Message 5 of 7 , Dec 7, 2006
            • 0 Attachment
              --- In libertybasic@yahoogroups.com, gordon sweer
              <gordonsweet2000@...> wrote:
              >
              > The program Hockey.bas supplied with LB does this.

              Actually Gordon it plays a .mid file, this thread discusses .mp3
            • gordon sweer
              My dodgey eyesight again. Hope this is not too log but the same API call plays MID, MP3 and WMA files. Gordon S. based on hockey.bas nomainwin dx = 1 : dy =
              Message 6 of 7 , Dec 8, 2006
              • 0 Attachment
                My dodgey eyesight again. Hope this is not too log but
                the same API call plays MID, MP3 and WMA files.

                Gordon S.

                ' based on hockey.bas
                nomainwin
                dx = 1 : dy = 1
                if DisplayWidth > 1000 then dx = 120 : dy = 90
                UpperLeftX = dx : UpperLeftY = dy
                WindowWidth = 800 : WindowHeight = 600
                open "MIDi Background tests" for graphics_nsb as
                #p
                #p "trapclose [quit]; font arial 30 bold italic"
                #p "color blue; place 200 400; down"
                #p "\PATTERNS TO MUSIC"
                size = 1 : tune = time$("seconds")
                gosub [startMusic]

                [pxl] #p "discard; fill black"
                ' Check if played over 180 seconds, then restart
                if time$("seconds") > tune + 180 then
                gosub [stopMusic]
                gosub [play]
                tune = time$("seconds")
                end if
                gosub [RGB] : GOSUB [init]
                count=1 : TS = T * S
                for r = 1 to 3
                FOR I = U TO N - 1 STEP K
                c = 1
                FOR J = V TO K
                scan
                if X < 0 then nx = -1 'LB does not
                if X = 0 then nx = 0 'not have a
                if X > 0 then nx = 1 'SGN function
                H = Y - nx * (ABS(B * X - C) ^ 0.5)
                Y = A - X: X = H
                px = int(TS * (X + Y))
                py = int(TS * (Y - X))
                px = px / 2 + 440
                py = py / 2 + 260
                #p "set ";str$(px);" ";str$(py)
                V = 1 : count = count + 1
                if count/200 =int(count/200) then
                count=1 : gosub [RGB]
                NEXT J
                U = 0
                NEXT I
                next r
                tim = time$("seconds")
                while time$("seconds") < tim + 2
                wend
                if size = 1 then size = 2 else size = 1
                if size = 1 then #p "size 1" else #p "size 2"
                goto [pxl]

                [init] rem initialise
                A1 = 5: T1 = 8: E1 = 1
                A = INT(RND(1) * 1000/100 - RND(1) * 1000) / 100
                B = INT(RND(1) * 1000/100 - RND(1) * 1000) / 100
                C = INT(RND(1) * 1000/100 - RND(1) * 1000) / 100
                S = INT(RND(1) * 20) + 10
                N = INT(RND(1) * 1000) + 500: K = N / 5
                U = 0: V = 1
                X = 0: Y = 0
                sq = 2 ^ 0.5 'Square Root
                T = 1 / sq: E1 = 0: P1 = 0
                rem XC = 640 - A * S * T: YC = 512
                return

                [RGB]
                red = int(rnd(1) * 256)
                green = int(rnd(1) * 256)
                blue = int(rnd(1) * 256)
                #p "color ";red;" ";green;" ";blue
                return

                [startMusic]
                DefaultDir$ = left$(DefaultDir$,2)+"\"
                filedialog "Any MP3, WAV or MIDi
                file","*.mid;*.mp3;*.wma",mus$
                if mus$ = "" then return
                mus$ = GetShortPathName$(mus$)
                ext$ = upper$(right$(mus$,3))
                [play]
                if ext$ = "MP3" or ext$ = "WMA" then a$="open
                "+mus$+" type MpegVideo alias fictoplay"
                if ext$ = "MID" then a$="open "+mus$+" type
                sequencer alias fictoplay"
                ' endMusicTime = time$("milliseconds")+60000+42000
                calldll #winmm,"mciSendStringA",a$ as ptr,_
                i1 as ulong,_
                i2 as long,_
                i3 as long,_
                r as long
                a$="play fictoplay"
                calldll #winmm,"mciSendStringA",_
                a$ as ptr,_
                i1 as ulong,_
                i2 as long,_
                i3 as long,_
                r as long
                return

                [stopMusic]
                a$="close fictoplay"
                calldll #winmm,"mciSendStringA",_
                a$ as ptr,_
                i1 as ulong,_
                i2 as long,_
                i3 as long,_
                r as long
                return

                [quit]
                gosub [stopMusic]
                close #p
                end

                Function GetShortPathName$(lPath$)
                lPath$=lPath$+Chr$(0)
                sPath$=Space$(256)
                lenPath=Len(sPath$)
                CallDLL #kernel32, "GetShortPathNameA",lPath$ As
                ptr,_
                sPath$ As ptr,lenPath As long,r As long
                GetShortPathName$=Left$(sPath$,r)
                End Function





                ___________________________________________________________
                Try the all-new Yahoo! Mail. "The New Version is radically easier to use" – The Wall Street Journal
                http://uk.docs.yahoo.com/nowyoucan.html
              • Stefan Pendl
                Message 7 of 7 , Dec 11, 2006
                • 0 Attachment
                  > [play]
                  > if ext$ = "MP3" or ext$ = "WMA" then a$="open "+mus$+"
                  > type MpegVideo alias fictoplay"
                  > if ext$ = "MID" then a$="open "+mus$+" type sequencer
                  > alias fictoplay"

                  Gordon,
                  if you omitt the type at all, then Windows will select the correct
                  codec to play the media file.
                  To play any filetype you like, use the following line:
                  a$="open "+mus$+" alias fictoplay"

                  If Windows can't find the correct codec to play the file, then it will raise
                  an error (eg. Codec not installed).

                  ---
                  Stefan Pendl






                  ___________________________________________________________
                  Der fr�he Vogel f�ngt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
                Your message has been successfully submitted and would be delivered to recipients shortly.