≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
DirectSound/WinMM and 3D audio
Posted by:
(you are not logged in)
Enter the missing letter in: "Int?rnational"
(you are not logged in)
Text:
[quote][b]ikt[/b] wrote: Hi there! I'm having a bit of trouble with getting 3D audio to behave. I'm using irrKlang x64, 1.6.0, and the following code to play audio: [code] Vector3 camPos = CAM::GET_GAMEPLAY_CAM_COORD(); Vector3 camRot = CAM::GET_GAMEPLAY_CAM_ROT(0); Vector3 camDir = RotationToDirection(camRot); mSoundEngine->setListenerPosition( { camPos.x, camPos.y, camPos.z }, { camDir.x, camDir.y, camDir.z }, { 0, 0, 0 }, { 0, 0, 1 } ); // Code to select a random soundName and do other stuff { Vector3 bonePos = ENTITY::GET_WORLD_POSITION_OF_ENTITY_BONE(vehicle, boneIdx); mSoundEngine->play3D(soundName.c_str(), { bonePos.x, bonePos.y, bonePos.z }); } [/code] Here, Z+ is "up". The direction vector is correct (using it, I can draw a debug sphere in front of the camera at all angles). When using DirectSound, the position of the sound is rather random. Sound never really separates and the direction doesn't match up with the camera. When switched to WinMM, the position of the sound *is* correct, but the stereo separation is too much, with a close, head-on sound being much louder than when the sound source is significantly left or right of the camera. I can't really figure out what's wrong in either situations. I'd use WinMM if not for the disparately loud noise when it plays from significantly left/right from the camera - or I'd use DirectSound if the positioning was correct. Is there anything I can do to solve these issues?[/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact