diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2018-07-09 22:49:07 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-07-09 22:49:07 -0300 |
| commit | 791fe70810f0f0f417c74aaff5446551bed78fee (patch) | |
| tree | 61cf0e4d7d2bbac931989b6dcd5e3adbacb5e28d /Ryujinx.HLE | |
| parent | 0a36bfbf921038e8eb7d4294ec8543903c933d90 (diff) | |
Allow sample rate of 0 on OpenAudioOut, fix 5.1 sound output (#240)
Diffstat (limited to 'Ryujinx.HLE')
| -rw-r--r-- | Ryujinx.HLE/OsHle/Services/Aud/IAudioOutManager.cs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Ryujinx.HLE/OsHle/Services/Aud/IAudioOutManager.cs b/Ryujinx.HLE/OsHle/Services/Aud/IAudioOutManager.cs index 54ffa6d9..8c78d1d4 100644 --- a/Ryujinx.HLE/OsHle/Services/Aud/IAudioOutManager.cs +++ b/Ryujinx.HLE/OsHle/Services/Aud/IAudioOutManager.cs @@ -14,6 +14,10 @@ namespace Ryujinx.HLE.OsHle.Services.Aud { private const string DefaultAudioOutput = "DeviceOut"; + private const int DefaultSampleRate = 48000; + + private const int DefaultChannelsCount = 2; + private Dictionary<int, ServiceProcessRequest> m_Commands; public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => m_Commands; @@ -122,7 +126,12 @@ namespace Ryujinx.HLE.OsHle.Services.Aud int SampleRate = Context.RequestData.ReadInt32(); int Channels = Context.RequestData.ReadInt32(); - if (SampleRate != 48000) + if (SampleRate == 0) + { + SampleRate = DefaultSampleRate; + } + + if (SampleRate != DefaultSampleRate) { Context.Ns.Log.PrintWarning(LogClass.Audio, "Invalid sample rate!"); @@ -133,7 +142,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud if (Channels == 0) { - Channels = 2; + Channels = DefaultChannelsCount; } KEvent ReleaseEvent = new KEvent(); @@ -145,7 +154,7 @@ namespace Ryujinx.HLE.OsHle.Services.Aud IAalOutput AudioOut = Context.Ns.AudioOut; - int Track = AudioOut.OpenTrack(SampleRate, 2, Callback, out AudioFormat Format); + int Track = AudioOut.OpenTrack(SampleRate, Channels, Callback, out AudioFormat Format); MakeObject(Context, new IAudioOut(AudioOut, ReleaseEvent, Track)); |
