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.

Dark GDK / 3dSound

Author
Message
Kurt
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location:
Posted: 25th Feb 2008 17:40
I have searched a bit on the forums but can't seem to find what is wrong.

First, I load all the sounds.


Then, for every update i position them and position the listener.(I use third person)



First, I want to position the sound to the place of my character, as it is his walking sound. Then position the listener, and rotate the listener to be facing the character, as the camera is.

But as I walk arround, the sound seems to be coming from different places. If I walk to one place, it's from the left and one place from the right. It should be the same, no matter where I am in the map. What am i doing wrong?

Seems to me like the sound isn't moving along with the characters. Any ideas?

Thanks
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 25th Feb 2008 19:33
3d Sound needs to be a single channel wave file - not a stereo one. This has goofed me up before.

Use MONO sounds - not ones with left and right channels.

Also note - there is sound scale, lister scale I think its call - and volume settings to play with obviously that could be killing you too.

Kurt
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location:
Posted: 25th Feb 2008 19:54
Thanks for your help. Although after looking that up, it WAS a mono sound. Any other idea?
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 26th Feb 2008 00:39
Bummer.

Quote: "Any other idea?"

Lots of experiments with Volumne, Positioning the listener, changing the listerner scale, try making a test app - with "ground" you can fly a camera around.

Load a 3dsound and loop it , and position it at 0,0,0. Put a CUBE there too so you can SEE where the sound is supposed to be.

Each loop - move the listener to the same position as the camera. Don't move the sound for this test - just the listener. You might need to Point the listener to the same angles as the came to but I foget if you can point the user's "head" or not.

That's kinda how I do my testing.

AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 26th Feb 2008 02:27 Edited at: 26th Feb 2008 02:28
Why are you giving dbRotateListener an object position as your parameters?? That won't make it face the object. In fact, if the object has a Y position of 0, then your listenere is probably facing down or up.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 26th Feb 2008 03:48
LOL

Go Look at how I Do it. I have a complete Project for you to play with and it has 3d sound

(I meant use the object for a visual - place the sound where the object is. This way when you fly near the object YOU SHOULD hear the sound - you'll know you're near it if you place the sound WHERE the object is. The LISTENER should be placed at your camera position)


Check this out - See Link in First Post:
http://forum.thegamecreators.com/?m=forum_view&t=110941&b=8&p=0

Kurt
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location:
Posted: 27th Feb 2008 12:35
Quote: "Why are you giving dbRotateListener an object position as your parameters?? That won't make it face the object. In fact, if the object has a Y position of 0, then your listenere is probably facing down or up. "


Look at the code. I rotate the Listener to the objects position, as the sound is coming from his position. So that my listener will be facing where the sound is coming from, as my camera is doing all the time.

To jason p sage:

I'll have a look at your code, thanks
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 27th Feb 2008 13:07
Did you grab that code? Did it run ok for you?

Kurt
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location:
Posted: 27th Feb 2008 13:14 Edited at: 27th Feb 2008 13:15
I checked and downloaded, but it is for DarkBasic, right? I don't have that, I use Visual C++

Edit:

Tried the game though. Very nicely done I'm impressed
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 27th Feb 2008 13:29
Well - the commands are very similiar. That download comes with an EXE - so you can see in action - then you can look in IISounds.dba to see how I loaded stuff and set it up - then look around for commands like POSITION SOUND (Which I do when updating the TANK position for example)

I REALIZE you MAY be running into a DarkGDK quirk - as I have not done any sound in DarkGDK really yet - but I would like to think this is unlikely.

Kurt
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location:
Posted: 27th Feb 2008 13:48
I think i actually fixed it, and it was embarrisingly easy.

I thought that the RotateListener would rotate the listener to an assigned point, although that was not the case. It rotates objects to an assigned degree. See code:

Login to post a reply

Server time is: 2024-09-29 13:29:54
Your offset time is: 2024-09-29 13:29:54