mp3 list?

Blitz3D Forums/Blitz3D Beginners Area/mp3 list?

Sephiroth(Posted 2004) [#1]
hi,

I am having problems on how to insert mp3s. I am a total beginner. but i looked in the manuals, searched the blitz site, looked at examples. but strangly. nothing?????

i want to know how i can load and play a mp3. thank you

============================================================

; LoadImage and DrawImage example

; Declares the GLOBAL variable which will be used throughout the program
Global player ; the player variable
Global snd ; sound variable
Global introPic ; intropic
Global x = 300 ; x coordinates of the player
Global y = 250 ; y coordinates of player

; Set a graphics mode
Graphics 800,600,16

; Set drawing operations for double buffering
SetBuffer BackBuffer()

; Load the image and assign its file handle to the variable
; - This assumes you have a graphic called player.bmp in the
; same folder as this source code

player=LoadImage("player.bmp") ; loads an image
snd = LoadSound ("amok.mp3") ; loads a sound file
intropic = LoadImage ("intro.jpg");
timer = CreateTimer(20)

DrawImage introPic, 1,1 ; draws intro pic
Flip ; flips it from back buffer

While Not KeyDown (57) ; waits for space bar to be pressed
Wend


;Starts a loop - this is the heart of the program
While Not KeyHit(1) ; this is saying : repeat until ESC key is hit. 1 is the scan code for the ESC key
Cls ; clear the screen

; moving the player around the screen
If KeyDown (200) y=y-2 ; if up arrow key is pressed, move ship up by decreasing the y value by 2
If KeyDown (203) x=x-2 ; if left arrow key is pressed, move ship left by decreasing the x value by 2
If KeyDown (205) x=x+2 ; if right arrow key is pressed, move ship up by increasing the x value by 2
If KeyDown (208) y=y+2 ; if down key is pressed, move ship down by increasing the y value by 2

If KeyDown (57) PlaySound snd ; plays the laser sound if space bar is pressed

DrawImage player,x,y ; Draw the player image and puts it at the x and y coordinates

Flip ; flip the image into view and clear the back buffer
Wend


Shambler(Posted 2004) [#2]
It looks like the sound is not getting loaded.

Try this,

snd = LoadSound ("amok.mp3") ; loads a sound file 
If snd=0 Then RuntimeError "Could not load sound!"


I believe there is a problem if the sound file has capital letters in the extension i.e. "amok.Mp3" or "amok.MP3", check the file and make sure they are lower case.


Sephiroth(Posted 2004) [#3]
its actually a music. but it wont do anything. just gives teh error....


Shambler(Posted 2004) [#4]
If it gives the runtime error then it means it couldn't find the sound.

So it's either not spelt correctly or it is not in the right folder.


Sephiroth(Posted 2004) [#5]
how can i add a attachment to this? so that i can show you


Shambler(Posted 2004) [#6]
Email it to me. jm.keay@...


Agamer(Posted 2004) [#7]
To check it is the dile name or not go to the file and go to rename it and right click and copy and thenpaste it in as tyour file name see how that can be helpful thats what I do :)