Keyboard and Sound questions... 
Author Message
 Keyboard and Sound questions...

During the development of the game mentioned in my previous post I came
across a few curiosities.

At first I tried using code like this to monitor the state of an arrow key
(there were no push buttons):
(Keyboard default isKeyDown: ##(Keyboard virtualKey: 'RIGHT'))
I did not get any errors, but it did not appear to work.  Did I do this
wrong, is there something I am missing?  I used a similar approach for
letter keys and they work fine.

I have some sound effects in my game.  I am loading a Sound from a wav file
and then using woof to play it.  The problem is that the sounds cut each
other off.  I would like the sounds to overlap.  Can that be done with
Sound, or do I have to use another API?  I guess I could use DirectSound if
I have to, but I was hoping to avoid that for now.

Chris



Sat, 29 Oct 2005 11:44:01 GMT  
 Keyboard and Sound questions...


Quote:

> I have some sound effects in my game.  I am loading a Sound from a wav
file
> and then using woof to play it.  The problem is that the sounds cut each
> other off.

I was thinking of doing a woofAndWait in another thread...


Sat, 29 Oct 2005 13:41:02 GMT  
 Keyboard and Sound questions...
Chris,

Quote:
> I have some sound effects in my game.  I am loading a Sound from a wav
file
> and then using woof to play it.  The problem is that the sounds cut each
> other off.  I would like the sounds to overlap.  Can that be done with
> Sound, or do I have to use another API?  I guess I could use DirectSound
if
> I have to, but I was hoping to avoid that for now.

I think you will have to use DirectSound. Actually, it's not as bad as is
sounds (my pun) since DirectSound is fairly easy. I have dug out the old
Dolphin 2.1 DirectX Kit and (wow) it still loads into D5. You can find it
at:

http://www.object-arts.co.uk/downloads/directx.zip

I have upgraded the packages to D5 format. Just load the Direct Sound
package, which will also pull in Direct X Base. Go to the package comment
and, with the current directory set to the DirectX directory (so the sound
files can be located) try running through the examples in the pacakge
comments. I'm not sure the added complexity of DirectSound is worth it for
your game (I liked the real simplicity) but as you see it's not that hard.

BTW, all the other DX packages load into D5 (there might be a few
compilation errors) but I haven't tried them to see if they work. If you
want to do so, you will have to remove the "Bouncing Balls" sample first
because there is a global name clash with Ball in one of the DX samples.

Good luck.

Best Regards,

Andy Bower
Dolphin Support
http://www.object-arts.com
---
Are you trying too hard?
http://www.object-arts.com/Relax.htm
---



Sat, 29 Oct 2005 18:00:19 GMT  
 Keyboard and Sound questions...
Folks,

Quote:
> BTW, all the other DX packages load into D5 (there might be a few
> compilation errors) but I haven't tried them to see if they work. If you
> want to do so, you will have to remove the "Bouncing Balls" sample first
> because there is a global name clash with Ball in one of the DX samples.

Actually, if you change the following method, you should find that all most
of the examples will work straight away. I didn't have much luck with the
DirectDraw samples but, then again, I didn't try very  hard. If you do mess
with them remember that Alt-F4 will close the example.

DirectX class>>queryMediaSearchPath
    "Private - Answer an ordered collection of directory Strings to be
searched
    when Actor3D media are loaded from files. By default this is just the
current directory
    and the media directory below it"

    ^Array with: '' with: 'media'

Better still change it to use a FileLocator.

Best Regards,

Andy Bower
Dolphin Support
http://www.object-arts.com
---
Are you trying too hard?
http://www.object-arts.com/Relax.htm
---



Sat, 29 Oct 2005 18:10:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. clipper dos sound to windows sound card

2. Sound through the sound card for MSWLogo?

3. REXX: Sound.CMD --- simple sound player !

4. sound WAVE sound

5. SOUND-a-SOUND

6. snack sound and multiple sound cards

7. Keyboards and Keyboard Interrupts

8. Tk keyboard traversal bugs on HP ITF keyboards

9. Keyboard focus and keyboard driven traversal

10. Another sound question help

11. Sound Question...

12. Sound question

 

 
Powered by phpBB® Forum Software