Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / sound file problem

Author
Message
cryptojoe
12
Years of Service
User Offline
Joined: 27th Sep 2012
Location: Michigan U.S.A
Posted: 1st Jan 2013 22:59 Edited at: 2nd Jan 2013 01:33
I added a sound file to my program thats a mp3 and the program compiles but at the beginning of run time I get a box with this message "could not add sound file groar1.mp3-Not a RIFF file at line 18" and when I click ok the program program terminates

line 18, LoadSound ( 2, "groar1.mp3" ) "line 18 is inside the DO loop"

*EDIT if I use groar1.mp3 as music it will play but I get the message if I try to use it as a sound
cryptojoe
12
Years of Service
User Offline
Joined: 27th Sep 2012
Location: Michigan U.S.A
Posted: 2nd Jan 2013 02:13
I can tell you that commands getbuttonpressed and getbuttonstate are not working with gamepads... I tryed 2 different ones "checked the settings and calibrated, but can only get X&Y from usb game pads..

they use the same Windows driver, 2Axes 11Keys game pad
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 2nd Jan 2013 02:43 Edited at: 2nd Jan 2013 02:48
IIRC sound files mist be a .wav format so an mp3 won't work.

cryptojoe
12
Years of Service
User Offline
Joined: 27th Sep 2012
Location: Michigan U.S.A
Posted: 2nd Jan 2013 02:52 Edited at: 2nd Jan 2013 03:24
oh, I'm sorry I did not know that... I will just convert them to .wav format then...

that just leaves the game pad problem to solve...
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 2nd Jan 2013 03:29
Quote: "that just leaves the game pad problem to solve..."

I'm afraid I can't help with that one as I don't have a gamepad. Good luck!

cryptojoe
12
Years of Service
User Offline
Joined: 27th Sep 2012
Location: Michigan U.S.A
Posted: 2nd Jan 2013 05:31 Edited at: 2nd Jan 2013 06:41
game pad problem is comeing from the IDE itself or the windows driver for the game pads... I'm useing the most common driver and it has ben working fine... I'm hopeing AppGameKit will fully support it in the future...

I have a nes usb controller that I love useing... buttons A&B map to 1&2 but select&start map to 9&10... the directional pad inputs work!
cryptojoe
12
Years of Service
User Offline
Joined: 27th Sep 2012
Location: Michigan U.S.A
Posted: 2nd Jan 2013 06:43 Edited at: 2nd Jan 2013 07:03
A&B may be working... I think its my code thats bad...

se1# = GetButtonPressed(1)
if se1# > 0.5 then PlaySound(1, 100, 0 )

can anyone see anything wrong with this?

*EDIT
changed getbuttonpredded to GetButtonState
and now code runs, but when Button a is pressed I get this messege "failed to creat sound instance at line 52"

my sound editing software has may different wave encoder options format/attributes

what should they be for agk?
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 2nd Jan 2013 09:55
Make sure the WAV is not compressed. You need PCM 8 or 16 bit, mono or stereo.

-- Jim DO IT FASTER, EASIER AND BETTER WITH AppGameKit FOR PASCAL
cryptojoe
12
Years of Service
User Offline
Joined: 27th Sep 2012
Location: Michigan U.S.A
Posted: 2nd Jan 2013 10:35 Edited at: 2nd Jan 2013 19:48
thanks jim... I've ben trying to get it right all night...

now if I can just get the guys at TGC to support the other 6 Buttons of the Windows driver, 2Axes 11Keys game pad..I would have all buttons working on both controllers
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 3rd Jan 2013 18:47 Edited at: 3rd Jan 2013 18:50
Quote: "se1# = GetButtonPressed(1)
if se1# > 0.5 then PlaySound(1, 100, 0 )"

Not sure why you are doing it like this as I am not even sure the joystick buttons support analogue input.
Try this:-

The first code would be best as it prevents the music from getting restarted while you hold the button down. Of course you could always add "and getsoundplaying(1)=0" to the end of the condition part to prevent you from restarting every click.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 3rd Jan 2013 19:31
DVader is correct. GetButtonPressed() returns either zero or one as an integer value.

Basic will sort of work with what you do, and not complain, but your usage is not quite right.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
cryptojoe
12
Years of Service
User Offline
Joined: 27th Sep 2012
Location: Michigan U.S.A
Posted: 4th Jan 2013 01:23
thanks, I will fix that... I always want my code to be the best it can be...

Login to post a reply

Server time is: 2024-11-24 06:19:55
Your offset time is: 2024-11-24 06:19:55