Post by Deleted on Mar 21, 2009 18:14:32 GMT -5
Hi Guilect,
i need your help !
i am just making a new sound lib with the 'bass.dll'.
when i want to load a song, then i will get always an error.
i cannot locating where this thing has an error.
maybe, you can find out it, and more see than i !
thank you.
Peter
you need this here: www.zshare.net/download/57404309c3e6f514/
Option Explicit
Private x,y,SongHnd
Sub Main()
Graphics.Initialize 300,300,True,16
Key.Initialize
Mouse.Initialize
InitMusic
StartMusic
SongHnd = LoadMusic("bgm.mp3")
PlayMusic(SongHnd)
Graphics.SetTitle("applied mathematics")
Graphics.Clear 255 * 65536 + 255 * 256 + 255 'lol
For x = 1 To 4 * 3.14159 Step 0.053
y = Sin(x)
Graphics.SetPoint Int(20*x),150 + Int(30*y),&hFF00FF00
Next
Graphics.Display
For x = 1 To 4 * 3.14159 Step 0.05
y = Cos(x)
Graphics.SetPoint Int(20*x), 150 + Int(30*y),&hFF0000FF
Next
Graphics.Display
For x = 1 To 4 * 3.14159 Step 0.01
y = Tan(x)
Graphics.SetPoint Int(20*x), 150 + Int(30*y),&hFFFF0000
Next
Graphics.Display
WaitKey()
Graphics.Terminate
Key.Terminate
Mouse.Terminate
End Sub
Call Main
Function InitMusic()
InitMusic = Dll.CallApi("bass","BASS_Init",-1,44100,0,Dll.CallApi("user32","GetDC",System.GethWnd))
End Function
Sub StartMusic()
Dll.CallApi "bass","BASS_Start"
End Sub
Sub FreeMusic(channel)
Dll.CallApi "bass","BASS_MusicFree",channel
Dll.CallApi "bass","BASS_Free"
End Sub
Function LoadMusic(File)
LoadMusic = Dll.CallApi("bass","BASS_StreamCreateFile",0,File,0,0,4) '4 = BASS_SAMPLE_LOOP
iF LoadMusic =0 Then MsgBox("LOAD ERROR!")
End Function
Function PlayMusic(mChannel)
PlayMusic = Dll.CallApi("bass","BASS_StreamPlay",mChannel,1,4) '4 = BASS_SAMPLE_LOOP
End Function
Function WaitKey()
While Key.PressedAny() = False
System.ProcessMessages
Wend
End Function
i need your help !
i am just making a new sound lib with the 'bass.dll'.
when i want to load a song, then i will get always an error.
i cannot locating where this thing has an error.
maybe, you can find out it, and more see than i !
thank you.
Peter
you need this here: www.zshare.net/download/57404309c3e6f514/
Option Explicit
Private x,y,SongHnd
Sub Main()
Graphics.Initialize 300,300,True,16
Key.Initialize
Mouse.Initialize
InitMusic
StartMusic
SongHnd = LoadMusic("bgm.mp3")
PlayMusic(SongHnd)
Graphics.SetTitle("applied mathematics")
Graphics.Clear 255 * 65536 + 255 * 256 + 255 'lol
For x = 1 To 4 * 3.14159 Step 0.053
y = Sin(x)
Graphics.SetPoint Int(20*x),150 + Int(30*y),&hFF00FF00
Next
Graphics.Display
For x = 1 To 4 * 3.14159 Step 0.05
y = Cos(x)
Graphics.SetPoint Int(20*x), 150 + Int(30*y),&hFF0000FF
Next
Graphics.Display
For x = 1 To 4 * 3.14159 Step 0.01
y = Tan(x)
Graphics.SetPoint Int(20*x), 150 + Int(30*y),&hFFFF0000
Next
Graphics.Display
WaitKey()
Graphics.Terminate
Key.Terminate
Mouse.Terminate
End Sub
Call Main
Function InitMusic()
InitMusic = Dll.CallApi("bass","BASS_Init",-1,44100,0,Dll.CallApi("user32","GetDC",System.GethWnd))
End Function
Sub StartMusic()
Dll.CallApi "bass","BASS_Start"
End Sub
Sub FreeMusic(channel)
Dll.CallApi "bass","BASS_MusicFree",channel
Dll.CallApi "bass","BASS_Free"
End Sub
Function LoadMusic(File)
LoadMusic = Dll.CallApi("bass","BASS_StreamCreateFile",0,File,0,0,4) '4 = BASS_SAMPLE_LOOP
iF LoadMusic =0 Then MsgBox("LOAD ERROR!")
End Function
Function PlayMusic(mChannel)
PlayMusic = Dll.CallApi("bass","BASS_StreamPlay",mChannel,1,4) '4 = BASS_SAMPLE_LOOP
End Function
Function WaitKey()
While Key.PressedAny() = False
System.ProcessMessages
Wend
End Function