我在C#上的Android上有一个audiorecording程序,当我调试程序时我有一个警告
已经阅读过很多主题,但我不明白是因为这个警告。提前谢谢recorder.Prepare(); //准备状态 (开放失败:ENOENT)
public class Recorder
{
MediaRecorder recorder = null;
public bool IsRecording { get { return recorder != null; } }
public void Start ()
{
var filePath = Player.filePath;
if (File.Exists (filePath)) {
File.Delete (filePath);
}
if (recorder == null) {
recorder = new MediaRecorder (); // Initial state.
} else {
recorder.Reset ();
}
recorder.SetAudioSource (AudioSource.Mic);
recorder.SetOutputFormat (OutputFormat.ThreeGpp);
recorder.SetAudioEncoder (AudioEncoder.AmrNb);
// Initialized state.
recorder.SetOutputFile (filePath);
// DataSourceConfigured state.
recorder.Prepare (); // Prepared state
recorder.Start (); // Recording state.
}
public void Stop ()
{
if (recorder != null){
recorder.Stop ();
recorder.Release ();
recorder = null;
}
}
}
}