scrawl
965aaebbdb
Analyze the loudness data as the stream is decoded for playback
...
Instead of getting the loudness data for the whole file in advance, we now get it piece by piece as the sound is streamed.
The benefit is that we need to decode the audio just once instead of twice.
We no longer need to rewind() the stream when the first decoding is done, this should hopefully fix bug #3453 .
2016-06-27 21:32:54 +02:00
scrawl
604b5d24e9
Use a ConstPtr in SoundManager
2015-12-18 18:11:30 +01:00
scrawl
53158d29b1
stopSound crash fix
2015-12-05 01:54:16 +01:00
Marc Zinnschlag
e0c9265148
Merge remote-tracking branch 'origin/master'
2015-12-03 15:56:24 +01:00
scrawl
86881bcf39
In first person mode, attach sound listener to the camera
2015-12-03 15:16:20 +01:00
Chris Robinson
3a39a92b93
Keep track of audio tracks
2015-12-02 16:09:24 -08:00
Chris Robinson
1ce3e7f5b9
Use a separate type for streams
...
They're basically the same, but it's to help avoid accidents with passing non-
streaming sounds to the stream functions, or vice-versa.
2015-12-02 16:09:24 -08:00
Chris Robinson
816015d6e6
Avoid inheriting from Sound for sound types
2015-12-02 16:09:24 -08:00
Alexander "Ace" Olofsson
24340bff95
Add a space
2015-11-30 17:47:36 +01:00
Alexander "Ace" Olofsson
6823298516
Different way to solve the type deduction issue
2015-11-30 17:42:25 +01:00
Alexander "Ace" Olofsson
a69e751089
Revert "Fix windows builds"
...
This reverts commit b085c09f86
.
2015-11-30 17:38:46 +01:00
Alexander "Ace" Olofsson
b085c09f86
Fix windows builds
...
Can't instantiate a container (at least with MSVC) without knowing the exact size of the object being stored, forward-declares only work with pointers.
I couldn't see a simple way to remove the forward declare, so pointers and memory management it is.
2015-11-30 13:36:15 +01:00
Chris Robinson
4ee409af84
Load loudness data asynchronously
...
Currently abuses the output audio streams' background processing thread to do
the work, since there's no generalized threaded processing mechanism.
2015-11-27 09:47:14 -08:00
Chris Robinson
21bb2e9314
Use a deque for loudness buffers with a map lookup
...
Similar to Sound_Buffer, this allows individual Sound_Loudness objects to
retain a constant pointer when new ones are inserted on to the end.
2015-11-27 02:01:18 -08:00
Chris Robinson
82f3651f81
Treat the sound offset as the offset in seconds
2015-11-27 02:01:17 -08:00
Chris Robinson
8b7587f9a6
Track whether a sound is 3D
2015-11-27 02:01:17 -08:00
Chris Robinson
d4238a6d91
Add config options for the sound buffer cache size
...
The cache size is specified with a min/max range, intended to avoid constant
unloading once the limit is reached. This way, buffers can be unloaded down to
a reasonable mimimum, allowing some more buffers to be subsequently loaded
without causing more unloading.
2015-11-26 02:13:37 -08:00
Chris Robinson
8715add72f
Store sound buffers in a deque that's filled in as needed
...
A deque allows existing Sound_Buffer references to remain valid as long as new
ones are back-inserted. These references can be used instead of indices.
2015-11-26 01:26:33 -08:00
Chris Robinson
aac903484c
Remove a really unnecessary method
2015-11-25 04:24:26 -08:00
Chris Robinson
73448c72f6
Replace Play_NoTrack with playManualSound3D, and rename the latter
2015-11-25 04:24:26 -08:00
Chris Robinson
caae305ddd
Use a sorted list for unused buffers
...
Helps ensure the buffers being unloaded due to cache limits are not likely to
be needed anytime soon.
2015-11-25 04:24:26 -08:00
Chris Robinson
3ce6aee98b
Return a decoder from the loadVoice function
2015-11-25 04:24:25 -08:00
Chris Robinson
24f8c78fca
Store sound buffer references by index instead of string
2015-11-25 04:24:24 -08:00
Chris Robinson
f9e18cd966
Prepare all Sound_Buffer objects when one is needed
...
This simply sets up the Sound record data to be used by the sound output. The
actual audio buffers, stored in the Sound_Handle, are still loaded on-demand.
2015-11-25 04:24:24 -08:00
Chris Robinson
6c3953766e
Use separate lists for the sound name and its buffer
...
This should make sound lookup a bit more efficient, especially when an integer
ID can be used.
2015-11-25 04:24:24 -08:00
Chris Robinson
fbfcc4050f
Stream voice clips
...
Voices tend to be a bit long, and not individually replayed often. So it's
better to stream them instead of loading theminto a sound buffer. The loudness
data is very small, though, so that can be kept buffered indefinitely.
2015-11-25 04:24:24 -08:00
Chris Robinson
0f33f41d8d
Actually unload sounds when running over
2015-11-25 04:24:23 -08:00
Chris Robinson
22a6811425
Limit the sound buffer cache to 15MB
2015-11-25 04:24:23 -08:00
Chris Robinson
0b2747098c
Keep track of unused sound buffers
2015-11-25 04:24:23 -08:00
Chris Robinson
e362896817
Combine some duplicate code
2015-11-25 04:24:23 -08:00
Chris Robinson
febc7b510a
Remove an unneeded method
2015-11-25 04:24:23 -08:00
Chris Robinson
3fdc3c4ea9
Use a separate map for say sounds
...
Also restores lip movement
2015-11-25 04:24:22 -08:00
Chris Robinson
9d0018e1bc
Reorder active sound data to make lookup by Ptr better
2015-11-25 04:24:22 -08:00
Chris Robinson
f4c22ec49e
Hold a separate list for voice sound buffers
...
This fixes say. Ideally voices would be streamed, but the loudness/"lip" buffer
extraction should be separated from the buffer loading code.
2015-11-25 04:24:22 -08:00
Chris Robinson
e2beefd8b5
Store info calculated from the ESM::Sound record
2015-11-25 04:24:22 -08:00
scrawl
152d690a7a
Minor cleanup
2015-05-23 23:10:53 +02:00
scrawl
7a3bc69df7
Readded sound listener
2015-05-12 19:02:56 +02:00
scrawl
8c7c89a4aa
Port SoundManager
2015-04-13 22:48:37 +02:00
scrawl
598c0c4ae7
Implement mouth animation for NPCs based on say sound ( Fixes #642 )
2014-07-29 01:15:22 +02:00
scrawl
09926a86cb
Fix comparing outdated listener position with up-to-date cell ( Fixes #1499 )
2014-06-25 18:10:26 +02:00
scrawl
d970cc06d7
Don't play the same music track twice in a row ( Fixes #746 )
2014-06-11 18:11:16 +02:00
scrawl
e5a21aca53
Refactor projectiles to no longer use MW-objects
2014-05-16 13:33:30 +02:00
Marc Zinnschlag
1b5301eec0
Merge branch 'savedgame'
...
Conflicts:
apps/openmw/mwbase/mechanicsmanager.hpp
apps/openmw/mwbase/soundmanager.hpp
apps/openmw/mwgui/mapwindow.hpp
apps/openmw/mwmechanics/actors.cpp
apps/openmw/mwmechanics/mechanicsmanagerimp.hpp
apps/openmw/mwsound/soundmanagerimp.hpp
components/esm/loadcell.cpp
2014-02-01 18:16:32 +01:00
Marc Zinnschlag
0f60898517
adding missing cleanup for SoundManager
2014-01-21 14:13:13 +01:00
scrawl
ba5300b071
Update the Ptr in SoundManager for references moved to a different cell. Fixes looping sounds not stopping after a moved object was already deleted.
2014-01-20 12:05:13 +01:00
Chris Robinson
02df8ab841
Store the underwater sound to easily stop it
2013-08-27 13:48:20 -07:00
PLkolek
f297c21e4d
Old door sound fades out on door open/close. Door sound is synchronised to angle on action.
2013-07-31 15:46:23 +02:00
Chris Robinson
14e0c182f3
Allow specifying the sound type to playSound and playSound3D
2013-07-18 21:50:11 -07:00
Chris Robinson
8a073c113e
Use const references where appropriate
2013-01-15 12:07:15 -08:00
Chris Robinson
7b2c3e6cd3
Pass a proper PlayMode enum to playSound and playSound3D
2012-12-18 06:01:21 -08:00