我想将音频文件保存为 .aac 格式并发送到 iPhone:
private string fileAudioName;
private IRandomAccessStream randomAccessStream;
private AudioVideoCaptureDevice mic;
private DispatcherTimer dtm;
private async void RecordAudio()
{
try
{
await MicStartAsync();
await StartRecordingAsync();
mic.AudioEncodingFormat = CameraCaptureAudioFormat.Aac;
dtm.Start();
_sw.Reset();
_sw.Start();
isRecording = true;
}
catch (Exception ex) { }
}
public async Task MicStartAsync()
{
mic = await AudioVideoCaptureDevice.OpenForAudioOnlyAsync();
}
public async Task StartRecordingAsync()
{
await CreateFileStreamForAudioAsync(fileAudioName + ".aac");
await mic.StartRecordingToStreamAsync(randomAccessStream);
}
但是在我将此音频文件发送到 iPhone 后,iPhone 无法读取它。