C#/Xamarin Maui
[Xamarin] 'audioQueue.Start() returned non-OK status: GeneralParamError'
kjun.kr
2021. 6. 20. 23:06
728x90
https://github.com/NateRickard/Plugin.AudioRecorder
NateRickard/Plugin.AudioRecorder
Audio Recorder plugin for Xamarin and Windows. Contribute to NateRickard/Plugin.AudioRecorder development by creating an account on GitHub.
github.com
위 누겟을 사용하여 마이크 녹음을 처리하고 있는데 iOS 에러 아래와 같은 에러가 발생되었다.
'audioQueue.Start() returned non-OK status: GeneralParamError' |
처음에는 파일 저장문제 인줄 알았는데 깃헙 이슈에 여러사람이 위문제를 물어보고 있었다
답은
AppDelegate.cs 에 아래 내용을 넣으면 된다.
AudioPlayer.RequestAVAudioSessionCategory(AVAudioSessionCategory.Playback); AudioRecorderService.RequestAVAudioSessionCategory(AVAudioSessionCategory.Record); |
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
CrossMediaManager.Current.Init();
AudioPlayer.RequestAVAudioSessionCategory(AVAudioSessionCategory.Playback);
AudioRecorderService.RequestAVAudioSessionCategory(AVAudioSessionCategory.Record);
LoadApplication(new App());
return base.FinishedLaunching(app, options);
}
}
728x90