Soundinit problems....

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

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.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Bonus.

Oops something went wrong, sorry for that !!!!

.oO BoNuS Oo.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

InitSound(), not SoundInit().
Use it without parameter.

Use DX7+ -> so DX8 is fine...

cya,
...Danilo
(registered PureBasic user)

Edited by - Danilo on 06 August 2002 20:23:03
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

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.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Bonus.

o and after playsound(5,1) the rest of the code ofcourse..

.oO BoNuS Oo.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

> InitSound(6)

Code: Select all

If InitSound() = 0
   MessageRequester("Error", "Can't initialize sound", 0): End
EndIf
tried this, like i said before ??

cya,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

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.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

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.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

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)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Bonus.

I have the 3.00 demo version, I just want to try this basic out...
I also tried it on the machine at work but the same problem over there so it isn't my machine...

.oO BoNuS Oo.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Andre.

Bonus, try out the new PB 3.30 demo. Should be released until tomorrow...

Regards
André

*** German PureBasic Support ***
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

RELEASED .

Fred - AlphaSND
Post Reply