- Switching to a EQ filter type that is more similar to XAudio2's filter
- Piping the per-voice high-frequency attenuation parameter to a new per-voice low-pass filter
- making the effect processing serial rather than parallel
- Clamping max volumes to 1.0 (linear) before setting volumes on API calls. Not doing this causes sounds to distort as max volume being used was 4.0 and we have volume scale factors greater than 1.0
[CL 2631483 by Aaron McLeran in Main branch]
- Re-adding the SAFE_CA_CALL wrapper around AUGraphUpdate since there a legit OSStatus code which can result from API call that isn't noErr. In the case of unpausing sounds, etc, this can happen.
[CL 2628158 by Aaron McLeran in Main branch]
- QAGame's Test map TM-MultipleSounds allowed me to finally repro the issue after a few minutes. Reducing the number of voices in CoreAudio caused the issue to happen immediately.
- Crash was due to an invalid audio unit index (-1) when the number of active audio units exceeds total number of available audio units
- Fixed by properly failing to play a sound if no audio unit/voice indices are available rather than trying to construct an AUGraph with the invalid index.
- Added more asserts to make sure things are what they should be.
- Changed the MAX_AUDIOCHANNELS #define used in Mac-code so it can be different than other platforms. Other platforms use this as an upper limit but don'''t allocate resources according to it, Mac however, allocates resources and allows voices to play up to the max number. Rather than fix that right now, we''ll hard-code that upper limit on mac to be on-par with PC
- Went ahead and reduced the number of max voices on Mac since PC only uses 32 and this was set to be 64 (for mono/stereo files) and 16 for multichannel files for a total of 80 max voices. Mac is already perf-heavy on the main thread, this will help to decrease perf due to audio and will be more in-line with PC audio.
#codereview Michael.Trepka Marc.Audy
#lockdown Nick.Penwarden
[CL 2623909 by Aaron McLeran in Main branch]
- Added stubs per platform in their ini file that doesn't change volume, except for mac which this bug is about and for which I reduced the volume by -6 dB. This can be changed by designers as per needed for their game per platform. The final headroom should be set by designers.
- Removed the hard-coded headroom constant used in OpenAL recently added.
[CL 2611741 by Aaron McLeran in Main branch]
Properly initialize audio resource when playing a native sound with a specified start time.
#codereview Aaron.McLeran
[CL 2588686 by Marc Audy in Main branch]
- checked in first-pass on CoreAudio (Mac/iOS) implementation of audio device module of new UnrealAudio
- fixed an issue with wrapping phase for sine functions (and thus fixed unit tests)
- changed simple device out unit test to be more simple (pure sine tone on each channel in octaves every second)
[CL 2519686 by Aaron McLeran in Main branch]
- Created audio device manager which manages weak ref handles to audio devices
- Audio device handles are created with WorldContexts and accessed through UWorld objects
- All access to audio devices are now through audio device handles
- There is a main/default audio device for GEngine for use with the Editor and single worldcontext games
#codereview marc.audy, matthew.griffin
[CL 2477046 by Aaron McLeran in Main branch]
Removed GVolumeMultiplier and added an equivalent to FApp to contain the code to load the unfocused volume multiplier from config.
UE-4449 - Allow users to choose whether audio can be heard when focus is lost
#codereview Robert.Manuszewski
[CL 2341022 by Matthew Griffin in Main branch]
- Inverse was one of the main reasons of crashes via lots of functions. Seems making default Inverse to be safer version seems better.
[CL 2255081 by Lina Halper in Main branch]
Implemented CookSurround function for AudioFormatOpus, refactoring as much common code from the standard Cook into re-usable functions.
Changed OpusAudioInfo class to use a multistream decoder for all sounds, as 1 and 2 channel sounds can still be decoded by it. Just had to create an array of mappings that would take the internal Opus format and give back PCM data in the order that Unreal expects.
Also made the OpusDecoderWrapper a true wrapper so that you don't have to use any opus functions outside of it and it will not function if WITH_OPUS is not defined.
Added a virtual function to the CompressedAudioInfo interface, to check whether its uncompressed data will be in the Vorbis format. This is to make sure that code currently just checking whether there is a DecompressionState can now be sure that the Vorbis format is being used before routing sound to different speakers.
Made sure that you can't cause any problems by adding or removing a SoundWave from the Audio Streaming Manager more than once. Also rearranged where sounds are added to the manager so that it is only done in one place and it's safe when changing quality triggers recompression/splitting.
Added a global multidimensional array to store all the Vorbis channel orderings as they needed to be used in multiple places.
Added Logging and Memory tracking for the streaming process.
[CL 2217839 by Matthew Griffin in Main branch]
New files added to contain FVorbisAudioInfo and FOpusAudioInfo, added all necessary includes
Added a few more checks for whether the target platform supports audio streaming where appropriate
Moved #define to .h file as it was being used in two .cpp files (working because of unity build)
[CL 2137973 by Matthew Griffin in Main branch]
Duplicate ResourceID would have caused the same problems in HTML5 and Linux as Android. Other duplications are errors waiting to happen, there are a couple of stats functions that could be using the base class versions and not displaying the correct information.
[CL 2119229 by Matthew Griffin in Main branch]
Moved most of the contents of FAudioDevice::FreeResource to USoundWave::FreeResources so that we can be sure that all memory is cleared up during teardown.
Removed FreeResource function from some subclasses of audio device, as they weren't doing anything different than the base one.
Also removed ListSounds function from these same classes as that seems to have fallen behind current base class version and isn't used anyway.
Removed platform specific audio buffer storage so that there isn't confusion about which is being used and ensured that casts are used when necessary.
Fixed compile issue with STAT_AudioResourceCreationTime for HTML5.
[CL 2109273 by Matthew Griffin in Main branch]