using System;
using System.Diagnostics;
namespace Ryujinx.Audio.Integration
{
///
/// Represent an hardware device used in
///
public interface IHardwareDevice : IDisposable
{
///
/// Sets the volume level for this device.
///
/// The volume level to set.
void SetVolume(float volume);
///
/// Gets the volume level for this device.
///
/// The volume level of this device.
float GetVolume();
///
/// Get the supported sample rate of this device.
///
/// The supported sample rate of this device.
uint GetSampleRate();
///
/// Get the channel count supported by this device.
///
/// The channel count supported by this device.
uint GetChannelCount();
///
/// Appends new PCM16 samples to the device.
///
/// The new PCM16 samples.
/// The number of channels.
void AppendBuffer(ReadOnlySpan data, uint channelCount);
///
/// Check if the audio renderer needs to perform downmixing.
///
/// True if downmixing is needed.
public bool NeedDownmixing()
{
uint channelCount = GetChannelCount();
Debug.Assert(channelCount > 0 && channelCount <= Constants.ChannelCountMax);
return channelCount != Constants.ChannelCountMax;
}
}
}