Commit Graph

174 Commits (8c7e06293fbe6d0ed1dd7dd0f424b9f1b6f92162)

Author SHA1 Message Date
Chris Robinson b3caf82714 Avoid using vector<>::data(), which requires C++11 13 years ago
Chris Robinson b8be867e6e Work around a bug in the Windows OpenAL router 13 years ago
Chris Robinson 87e8917c4d Don't try to play sounds when no sound output is initialized 13 years ago
Chris Robinson 9c06bfc8fc Merge remote branch 'zini/master' into sound 13 years ago
Alexander "Ace" Olofsson 64f792c01d Fix a value defined at the wrong place 13 years ago
Chris Robinson 4944a29b21 Keep track of the sound pitch 13 years ago
Chris Robinson cbf6c0404a Implement a basic underwater sound environment 13 years ago
Chris Robinson 575474ff69 Pass the mode flags to the sound output play methods 13 years ago
Chris Robinson bfac946878 Finally "fix" --nosound
Expect degraded performance with it. Looping sounds are constantly checked to
see if they're playing, and try to play it again when it's not.
13 years ago
Chris Robinson 28378c063b Minor OpenAL_SoundStream cleanups 13 years ago
Chris Robinson b01289128b Split OpenAL_Sound into separate classes for 2D and 3D sounds 13 years ago
Chris Robinson 5adeee20fd Mute sounds that go outside the max distance 13 years ago
Chris Robinson fc167dbc83 Pass Ogre Vector3s to playSound3D and updateListener 13 years ago
Chris Robinson fefc8f86ab Remove the unused streamSound3D method 13 years ago
Chris Robinson 1ee8b963d0 Store the sound listener position as well 13 years ago
Chris Robinson fad27d99e6 Update the actual sound volume with the position 13 years ago
Chris Robinson 479df78ea1 Update the actual sound position after the listener 13 years ago
Chris Robinson de102cd274 Simplify broken OpenAL workaround 13 years ago
Nikolay Kasyanov b6aa8925f4 (Temporary) workaround for broken OpenAL implementations that doesn't return meaningful max counts of sources 13 years ago
Nikolay Kasyanov 20f976ddc7 probably openal initialization fix 13 years ago
Chris Robinson bedf56a237 Merge remote branch 'zini/next' into sound 13 years ago
Chris Robinson 293f33914e Use a deque fpr OpenAL's free sources 13 years ago
Chris Robinson a3291ef360 Add a sound method to update the volume 13 years ago
Chris Robinson c072babd17 Better handle bad OpenAL source counts 13 years ago
Chris Robinson c6c06f1140 Return SoundPtr objects from the playSound and streamSound methods 13 years ago
Alexander "Ace" Olofsson 55f1053b4f Windows fixes for compiling and linking 13 years ago
Chris Robinson 7b3ecc290e Fix compilation with older OpenAL headers 13 years ago
Chris Robinson 5cb90ab704 Add some dummy copy constructors and assignment operators to prevent implicit versions from being used 13 years ago
Chris Robinson 1ccddefe28 Properly report the default device when opening sound fails 13 years ago
Chris Robinson 2f0af42261 Use the ALC_ENUMERATE_ALL_EXT extension with OpenAL when available 13 years ago
Chris Robinson 15317796bf Handle the wav -> mp3 extension conversion in the sound output backend 13 years ago
Chris Robinson f11e3e39a1 Add an enumerate method to the sound output interface 13 years ago
Chris Robinson 8c5f85ca83 Use a local variable to mark sound streams as finished while processing
This avoids a race condition where the source can underrun while the final
buffers are being queued and the sound can be detected as stopped
13 years ago
Chris Robinson 0d973ac8ff Use the vector's data field instead of the address of the first element
Same thing really, but less convoluted
13 years ago
Chris Robinson 26a441f29a Add a readAll method to the sound decoder, for potentially more efficient reading 13 years ago
Chris Robinson fd37a4827c Enforce a 15MB limit on the sound buffer cache 13 years ago
Chris Robinson 6c45d6668b Cache OpenAL buffers for easy reuse 13 years ago
Chris Robinson 91821ccd8c Add the sound stream to the thread after resetting the mIsFinished flag 13 years ago
Chris Robinson db46bf39b3 Add a rewind method to the sound decoder 13 years ago
Chris Robinson afa2cb6de7 Stop trying to read decoded audio once it's finished 13 years ago
Chris Robinson 4f69972a9c Add a method to stream a sound in 3D 13 years ago
Chris Robinson ae8218bf03 Allocate OpenAL sources when opening the device
This allows sources to be more efficiently retrieved and returned
13 years ago
Chris Robinson 8f9d4ff841 Use 6 125ms buffers for OpenAL streams 13 years ago
Chris Robinson dc6354b2f9 Add functions to get string names for sample types and channel configs 13 years ago
Chris Robinson 4a0b5b7918 Increase the sound stream thread sleep time to 50ms 13 years ago
Chris Robinson 4698e8c0a2 Make the sound stream thread object per-device 13 years ago
Chris Robinson 2c27827e4f Add some comment markers to the OpenAL sound classes 13 years ago
Chris Robinson e234b90173 Use a loop to find the OpenAL format from the decoder format 13 years ago
Chris Robinson 6a256d3993 Make sure the OpenAL stream list is clear before shutting down 13 years ago
Chris Robinson 7194114669 Use a background thread to keep OpenAL streams fed
Maybe this could be moved to the SoundManager instead of in OpenAL, but it's
good enough for now.
13 years ago
Chris Robinson b938fd7b36 Make the sound output init return void 13 years ago
Chris Robinson 1965b5bc79 Rename some Sound class member functions 13 years ago
Chris Robinson 403e51cef3 Move the sample type and channel config enums to MWSound and give use appropriate names for the values 13 years ago
Chris Robinson efae7dfe83 Rename some sound decoder class member variables and functions 13 years ago
Chris Robinson 9656456d30 Make sure the sound decoders are closed when they're finished with 13 years ago
Chris Robinson 362e254720 Rename some more sound class member variables and functions 13 years ago
Chris Robinson 2f92559fc7 Use OpenAL's linear attenuation model
We should use the inverse distance clamped model (the default), but we first
need to handle muting sounds that are beyond their max distance. Linear
attenuation doesn't give a proper rolloff, but it makes the sounds silent at
max distance.
13 years ago
Chris Robinson f7ac94d686 Pass the new position to the sound update method 13 years ago
Chris Robinson 44fc204864 Avoid passing a sound decoder to the play methods 13 years ago
Chris Robinson 7160d20db3 Be more consistent with the vector orientations given the sound handler 13 years ago
Chris Robinson 87adf6002a Fix a copy-paste typo in the openal output 13 years ago
Chris Robinson 5563f583ff Add and implement methods to update tracked sounds on an object 13 years ago
Chris Robinson 979ae89aab Pass volume and pitch parameters to streamed sounds 13 years ago
Chris Robinson cac07d0fbf Remove some unnecessary methods 13 years ago
Chris Robinson d57051375d Implement non-streaming sounds with OpenAL 13 years ago
Chris Robinson 656863ec6e Add functions to play sounds 13 years ago
Chris Robinson a46f8ced05 Keep the sound output's listener updated with the camera position 13 years ago
Chris Robinson 2dabdcb9e5 Add a function to update the sound listener 13 years ago
Chris Robinson 2429755bf1 Make the sound's Play method return void 13 years ago
Chris Robinson caf5d71d44 Make the sound decoder's Open method return void
Errors are thrown, not returned
13 years ago
Chris Robinson 1b41987e18 Move OpenAL_SoundStream function definitions out of the class 13 years ago
Chris Robinson 1ade01edc8 Add a function to stream sounds 13 years ago
Chris Robinson 1322b1e160 Move Sound_Output's definition to a separate header 13 years ago
Chris Robinson 45b612ab3b Add a skeleton output classs using OpenAL 13 years ago