locked
Missing Audio when Using MediaCapture to Record an Audio File

    Question

  • When I use MediaCapture to record an audio file, save it to Azure Blob Storage, and then download it to play it back invariably the first 5 to 6 seconds of the recording are blank. Is there some fix to this? The code I'm using is the standard, as shown below.

    var settings = new MediaCaptureInitializationSettings();
                    settings.StreamingCaptureMode = StreamingCaptureMode.Audio;
                    settings.AudioProcessing = Windows.Media.AudioProcessing.Default;
                    _mediaCapture = new MediaCapture();
                    await _mediaCapture.InitializeAsync(settings);
                    _mediaCapture.RecordLimitationExceeded += new Windows.Media.Capture.RecordLimitationExceededEventHandler(RecordLimitationExceeded);
                    _mediaCapture.Failed += new Windows.Media.Capture.MediaCaptureFailedEventHandler(Failed);

                    var recordProfile = MediaEncodingProfile.CreateM4a(AudioEncodingQuality.Auto);

                    await _mediaCapture.StartRecordToStorageFileAsync(recordProfile, AudioStorageFile);

    Saturday, February 21, 2015 10:43 PM

All replies

  • Hi IMOsiris,

    Does the record file lost the first 5 seconds when complete recording in windows phone? We need avoid the confounding factors with Azure. Please test it.

    If lost, we can use the code sample from MSDN code gallery to test whether the problem is persists. Post the result here and I will check if this is a known issue. https://code.msdn.microsoft.com/windowsapps/media-capture-sample-adf87622.

    If not, that means there is something incorrect when downloading file from Azure. You need to post on Azure forum to report this issue.

    Feel free to let me know if you have any concerns.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Monday, February 23, 2015 6:21 AM
    Moderator
  • From the code above a file is created and populated with a recording. Even at that stage--before the audio file is uploaded to Azure--the first 5 to 6 seconds of a recording are not captured in the file created in local storage. While I'm developing for a Windows 8.1 store app, I cannot believe that a phone app would perform any differently. I think MediaCapture is to blame. It's as if MediaCapture needs to warm up before being ready to capture audio. Has anyone seen this problem before??? And then solved???
    Monday, February 23, 2015 10:14 AM
  • Hi IMOsiris,

    Can you post a mini repro project to help reproduce your problem? User your OneDrive and share a link here.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Tuesday, February 24, 2015 6:04 AM
    Moderator
  • I am using the same exact code as found under this Microsoft sample. By the way, it too does not capture the first 5 seconds of an audio recording.

    https://code.msdn.microsoft.com/windowsapps/Media-Capture-Sample-adf87622

    Wednesday, February 25, 2015 6:09 AM