mirror of
https://github.com/SineVector241/VoiceCraft-MCBE_Proximity_Chat.git
synced 2024-11-12 02:19:17 +00:00
53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
using NAudio.Wave;
|
|
using VoiceCraft.Maui.Interfaces;
|
|
|
|
namespace VoiceCraft.Maui
|
|
{
|
|
public class AudioManager : IAudioManager
|
|
{
|
|
public static AudioManager Instance { get; } = new AudioManager();
|
|
|
|
public IWavePlayer CreatePlayer(ISampleProvider AudioFormat)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public IWaveIn CreateRecorder(WaveFormat AudioFormat, int bufferMS)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public string[] GetInputDevices()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public string[] GetOutputDevices()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public int GetInputDeviceCount()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public int GetOutputDeviceCount()
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public async Task<bool> RequestInputPermissions()
|
|
{
|
|
var status = await Permissions.RequestAsync<Permissions.Microphone>();
|
|
if (Permissions.ShouldShowRationale<Permissions.Microphone>())
|
|
{
|
|
Shell.Current.DisplayAlert("Error", "VoiceCraft requires the microphone to communicate with other users!", "OK").Wait();
|
|
return false;
|
|
}
|
|
|
|
return status == PermissionStatus.Granted;
|
|
}
|
|
}
|
|
}
|