Crystal Space
Welcome, Guest. Please login or register.
October 17, 2017, 04:31:58 pm

Login with username, password and session length
Search:     Advanced search
9063 Posts in 2051 Topics by 77009 Members
Latest Member: Adesoladebow826
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Can't get directional sound working
« previous next »
Pages: [1] Print
Author Topic: Can't get directional sound working  (Read 1526 times)
Jr. Member
Posts: 62

View Profile
« on: October 23, 2006, 02:01:58 pm »

The soundsource is always omnidirectional, no matter how i define the sound direction and cone-angle  sad
I want to simulate a worldspace fixed directional sound.
I use one of the latest svn snapshops, compiled for WinXP
The updating of the sound is done as follows:

  csVector3 worldPos(70.0f, 20.0f, -3.3f);
  csVector3 pos = view->GetCamera ()->GetTransform ().Other2This (worldPos);
  sndsource3d->SetPosition (pos); // sndsource3d is a iSndSysSourceSoftware3D interface
  csVector3 worldDir(0.0f, 0.0f, -1.0f);
  pos = view->GetCamera ()->GetTransform ().Other2ThisRelative (worldDir);
  sndsource3d->SetDirection (pos);
  sndsource3d->SetDirectionalRadiation (3.14f/20.0f);
The position is updated properly, only the directional part does't work

Another thing i noticed is that the sound is not "muted" when the distance of the sound is larger than the distance specified with sndsource3d::SetMaximumDistance()

comment from ss_source.h:
   * Set the greatest distance from a sound at which the sound can be heard.
   * If the distance to a listener is above this threshold, it will not be
   * mixed into the output buffer at all.  This saves a tiny bit of processing.

Another comment in ss_source.h says:
   * Set the greatest distance from a sound at which the sound plays at full
   * amplitude.
   * When a listener is closer than this distance, the amplitude is the volume
   * of the sound.
   * When a listener is further than this distance, the amplitude follows the
   * formula V = (volume / ((distance/minimum_distance) ^ rolloff_factor))
  virtual void SetMinimumDistance (float distance) = 0;
This seems to work, however I can't find a method to change the rolloff_factor sad

does anyone know how to do these things right?
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 4.142 seconds with 15 queries.