How to format audio file into aac in window phone 8?

115 Views Asked by At

I want save audio file into .aac format and send to 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);
}

But after I send this audio file to iPhone, iPhone can't read it.

0

There are 0 best solutions below