aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Audio/Renderers/OpenAL/OpenALAudioTrack.cs
diff options
context:
space:
mode:
authorMary <me@thog.eu>2020-08-18 21:03:55 +0200
committerGitHub <noreply@github.com>2020-08-18 21:03:55 +0200
commit5b26e4ef94afca8450f07c42393180e3c97f9c00 (patch)
tree5c698591bd557711a487430ba06921b10ce53761 /Ryujinx.Audio/Renderers/OpenAL/OpenALAudioTrack.cs
parenta389dd59bd881cf2cff09a1f67f5c30de61123e6 (diff)
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)
Diffstat (limited to 'Ryujinx.Audio/Renderers/OpenAL/OpenALAudioTrack.cs')
-rw-r--r--Ryujinx.Audio/Renderers/OpenAL/OpenALAudioTrack.cs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Ryujinx.Audio/Renderers/OpenAL/OpenALAudioTrack.cs b/Ryujinx.Audio/Renderers/OpenAL/OpenALAudioTrack.cs
index 8629dc96..2f150998 100644
--- a/Ryujinx.Audio/Renderers/OpenAL/OpenALAudioTrack.cs
+++ b/Ryujinx.Audio/Renderers/OpenAL/OpenALAudioTrack.cs
@@ -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>();