Misc audio fixes (#1348)

Changes:

    Implement software surround downmixing (fix #796).
    Fix a crash when no audio renderer were created when stopping emulation.

NOTE: This PR also disable support of 5.1 surround on the OpenAL backend as we cannot detect if the hardware directly support it. (the downmixing applied by OpenAL on Windows is terribly slow)
This commit is contained in:
Mary 2020-08-18 21:03:55 +02:00 committed by GitHub
parent a389dd59bd
commit 5b26e4ef94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 302 additions and 30 deletions

View file

@ -12,6 +12,9 @@ namespace Ryujinx.Audio
public ALFormat Format { get; private set; }
public PlaybackState State { get; set; }
public int HardwareChannels { get; }
public int VirtualChannels { get; }
private ReleaseCallback _callback;
private ConcurrentDictionary<long, int> _buffers;
@ -21,13 +24,16 @@ namespace Ryujinx.Audio
private bool _disposed;
public OpenALAudioTrack(int sampleRate, ALFormat format, ReleaseCallback callback)
public OpenALAudioTrack(int sampleRate, ALFormat format, int hardwareChannels, int virtualChannels, ReleaseCallback callback)
{
SampleRate = sampleRate;
Format = format;
State = PlaybackState.Stopped;
SourceId = AL.GenSource();
HardwareChannels = hardwareChannels;
VirtualChannels = virtualChannels;
_callback = callback;
_buffers = new ConcurrentDictionary<long, int>();