Soundinit problems....
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Bonus.
Hi guys (and maybe even girls)
I am new to Pure basic, but not to basic. I have a small problem
with SoundInit. It keeps says Incorrect number of parameters.
But I us it as writen in the helpfile !!!
Do I really have to have Directx 7 installed or is a later version
also good. Because I used to work under 8.0 and my programs worked.
But lately nothing seems to work anymore.
Whats wrong...
.oO BoNuS Oo.
Hi guys (and maybe even girls)
I am new to Pure basic, but not to basic. I have a small problem
with SoundInit. It keeps says Incorrect number of parameters.
But I us it as writen in the helpfile !!!
Do I really have to have Directx 7 installed or is a later version
also good. Because I used to work under 8.0 and my programs worked.
But lately nothing seems to work anymore.
Whats wrong...
.oO BoNuS Oo.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Bonus.
That's what I wanted to say, InitSound().
I use then InitSound(6) because I have 6 samples i want to
play. But it wouldn't even get to the loading of the samples.
see code
; Init sprites
If InitSprite() = 0
MessageRequester("Error", "Can't open DirectX 7 Or later", 0)
End
EndIf
; Init Keyboard
If InitKeyboard() = 0
MessageRequester("Error", "Can't open DirectX 7 Or later", 0)
End
EndIf
InitSound(6)
LoadSound(1,"data\open.wav")
LoadSound(2,"data\exo1.wav")
LoadSound(3,"data\logoff.wav")
LoadSound(4,"data\menuclick.wav")
LoadSound(5,"data\m_funk.wav")
PlaySound(5,1)
.oO BoNuS Oo.
That's what I wanted to say, InitSound().
I use then InitSound(6) because I have 6 samples i want to
play. But it wouldn't even get to the loading of the samples.
see code
; Init sprites
If InitSprite() = 0
MessageRequester("Error", "Can't open DirectX 7 Or later", 0)
End
EndIf
; Init Keyboard
If InitKeyboard() = 0
MessageRequester("Error", "Can't open DirectX 7 Or later", 0)
End
EndIf
InitSound(6)
LoadSound(1,"data\open.wav")
LoadSound(2,"data\exo1.wav")
LoadSound(3,"data\logoff.wav")
LoadSound(4,"data\menuclick.wav")
LoadSound(5,"data\m_funk.wav")
PlaySound(5,1)
.oO BoNuS Oo.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
> InitSound(6)
tried this, like i said before ??
cya,
...Danilo
(registered PureBasic user)
> InitSound(6)
Code: Select all
If InitSound() = 0
MessageRequester("Error", "Can't initialize sound", 0): End
EndIfcya,
...Danilo
(registered PureBasic user)
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Bonus.
Okay build that in my source file but now I get "Can't create the 'PureBasic.exe' file (already running ?) in an Alert box...
So what wrong now ??? I tried another program called "animballz" ccomplied it and run and that works okay. But there is NO sound in it...
.oO BoNuS Oo.
Okay build that in my source file but now I get "Can't create the 'PureBasic.exe' file (already running ?) in an Alert box...
So what wrong now ??? I tried another program called "animballz" ccomplied it and run and that works okay. But there is NO sound in it...
.oO BoNuS Oo.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Bonus.
I also tried the source below, a standard demo listing but that one
gives me the same error as above.
; ------------------------------------------------------------
; PureBasic - Sound example file
; (c) 2001 - Fantaisie Software
;------------------------------------------------------------
If InitSound() = 0
MessageRequester("Error", "Can't open DirectX 7 or no sound card is available", 0)
End
EndIf
SoundFileName$ = OpenFileRequester("Choose a .wav file", "", "Wave files|*.wav",0)
If SoundFileName$
If LoadSound(0, SoundFileName$)
PlaySound(0,1)
MessageRequester("Sound", "Playing the sound (loop)..."+Chr(10)+"Click to quit..", 0)
Else
MessageRequester("Error", "Can't load the sound.", 0)
EndIf
EndIf
End
.oO BoNuS Oo.
I also tried the source below, a standard demo listing but that one
gives me the same error as above.
; ------------------------------------------------------------
; PureBasic - Sound example file
; (c) 2001 - Fantaisie Software
;------------------------------------------------------------
If InitSound() = 0
MessageRequester("Error", "Can't open DirectX 7 or no sound card is available", 0)
End
EndIf
SoundFileName$ = OpenFileRequester("Choose a .wav file", "", "Wave files|*.wav",0)
If SoundFileName$
If LoadSound(0, SoundFileName$)
PlaySound(0,1)
MessageRequester("Sound", "Playing the sound (loop)..."+Chr(10)+"Click to quit..", 0)
Else
MessageRequester("Error", "Can't load the sound.", 0)
EndIf
EndIf
End
.oO BoNuS Oo.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Danilo.
> ;------------------------------------------------------------
> ; PureBasic - Sound example file
> ; (c) 2001 - Fantaisie Software
> ;------------------------------------------------------------
Works fine for me like it is.
Do you use the Demo 3.00 or Registered 3.20 ??
Maybe a problem with your sound driver ??
cya,
...Danilo
(registered PureBasic user)
> ;------------------------------------------------------------
> ; PureBasic - Sound example file
> ; (c) 2001 - Fantaisie Software
> ;------------------------------------------------------------
Works fine for me like it is.
Do you use the Demo 3.00 or Registered 3.20 ??
Maybe a problem with your sound driver ??
cya,
...Danilo
(registered PureBasic user)
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm