diff options
author | gdkchan <gab.dark.100@gmail.com> | 2024-02-22 16:58:33 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-22 16:58:33 -0300 |
commit | d4d0a48bfe89d6e8e12ce16829bb2c440b56007c (patch) | |
tree | 2376566ed2c06181b3dbc547b1f99f5b533d918b /src/Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs | |
parent | 57d8afd0c99bb43d1ba1e3cc630d257c5da92741 (diff) |
Migrate Audio service to new IPC (#6285)1.1.1211
* Migrate audren to new IPC
* Migrate audout
* Migrate audin
* Migrate hwopus
* Bye bye old audio service
* Switch volume control to IHardwareDeviceDriver
* Somewhat unrelated changes
* Remove Concentus reference from HLE
* Implement OpenAudioRendererForManualExecution
* Remove SetVolume/GetVolume methods that are not necessary
* Remove SetVolume/GetVolume methods that are not necessary (2)
* Fix incorrect volume update
* PR feedback
* PR feedback
* Stub audrec
* Init outParameter
* Make FinalOutputRecorderParameter/Internal readonly
* Make FinalOutputRecorder IDisposable
* Fix HardwareOpusDecoderManager parameter buffers
* Opus work buffer size and error handling improvements
* Add AudioInProtocolName enum
* Fix potential divisions by zero
Diffstat (limited to 'src/Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs')
-rw-r--r-- | src/Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/src/Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs b/src/Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs index 9c885b2c..3e11df05 100644 --- a/src/Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs +++ b/src/Ryujinx.Audio/Renderer/Dsp/AudioProcessor.cs @@ -45,7 +45,6 @@ namespace Ryujinx.Audio.Renderer.Dsp _event = new ManualResetEvent(false); } -#pragma warning disable IDE0051 // Remove unused private member private static uint GetHardwareChannelCount(IHardwareDeviceDriver deviceDriver) { // Get the real device driver (In case the compat layer is on top of it). @@ -59,9 +58,8 @@ namespace Ryujinx.Audio.Renderer.Dsp // NOTE: We default to stereo as this will get downmixed to mono by the compat layer if it's not compatible. return 2; } -#pragma warning restore IDE0051 - public void Start(IHardwareDeviceDriver deviceDriver, float volume) + public void Start(IHardwareDeviceDriver deviceDriver) { OutputDevices = new IHardwareDevice[Constants.AudioRendererSessionCountMax]; @@ -70,7 +68,7 @@ namespace Ryujinx.Audio.Renderer.Dsp for (int i = 0; i < OutputDevices.Length; i++) { // TODO: Don't hardcode sample rate. - OutputDevices[i] = new HardwareDeviceImpl(deviceDriver, channelCount, Constants.TargetSampleRate, volume); + OutputDevices[i] = new HardwareDeviceImpl(deviceDriver, channelCount, Constants.TargetSampleRate); } _mailbox = new Mailbox<MailboxMessage>(); @@ -231,33 +229,6 @@ namespace Ryujinx.Audio.Renderer.Dsp _mailbox.SendResponse(MailboxMessage.Stop); } - public float GetVolume() - { - if (OutputDevices != null) - { - foreach (IHardwareDevice outputDevice in OutputDevices) - { - if (outputDevice != null) - { - return outputDevice.GetVolume(); - } - } - } - - return 0f; - } - - public void SetVolume(float volume) - { - if (OutputDevices != null) - { - foreach (IHardwareDevice outputDevice in OutputDevices) - { - outputDevice?.SetVolume(volume); - } - } - } - public void Dispose() { GC.SuppressFinalize(this); @@ -269,6 +240,7 @@ namespace Ryujinx.Audio.Renderer.Dsp if (disposing) { _event.Dispose(); + _mailbox?.Dispose(); } } } |