How to record audio input along with AppRecordingManager?

MG Bhadurudeen 626 Reputation points
2021-02-15T12:09:15.063+00:00

Hi, I am able to record my app's screen as a video using AppRecordingManager. Now I want to add the audio input of my pc, for example, a mic. so that the result should be the video of my app + audio input from the mic. How to do this? Sorry, I could not find a sample to record the audio. Any help is greatly appreciated.

var manager = AppRecordingManager.GetDefault();
manager.StartRecordingToFileAsync(storageFile);
Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Nico Zhu (Shanghai Wicresoft Co,.Ltd.) 12,846 Reputation points
    2021-02-16T01:30:35.85+00:00

    Hello, Welcome to Micorosoft Q&A,

    I'm afraid you can't implement this with AppRecordingManager, Currently, it has not provide audio input, for your scenario, we suggest you use mediaCapture to capture audio at same time, and use media editing to merge audio video file. And you could also post your requirements with windows feed back hub that ask more features for AppRecordingManager .


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Singh Wong 51 Reputation points
    2021-02-17T13:20:31.91+00:00

    You can use API MediaComposition (media-compositions-and-editing) to merge video and audio files. Below is the sample code.

    var composition = new MediaComposition();  
    StorageApplicationPermissions.FutureAccessList.Add(video_file);  
    var clip = await MediaClip.CreateFromFileAsync(video_file);  
    composition.Clips.Add(clip);  
    StorageApplicationPermissions.FutureAccessList.Add(audio_file);  
    var backgroundTrack = await BackgroundAudioTrack.CreateFromFileAsync(audio_file);  
    composition.BackgroundAudioTracks.Add(backgroundTrack);  
    var saveOperation = await composition.RenderToFileAsync(saveFilePath,   
    MediaTrimmingPreference.Fast)  
                            .AsTask(new Progress<double>(p =>  
                            {  
                                progressBar.Value = p;  
                            }));  
    
    2 people found this answer helpful.
    0 comments No comments

  2. MG Bhadurudeen 626 Reputation points
    2021-02-16T12:49:59.293+00:00

    Thank you so much. From your answer, I have implemented the audio recording feature in my app with the mediaCapture. Now the 2nd part,

    use media editing to merge audio video file.

    What do you mean by this? What API should I use? Could you please share the Link? So far, I have created both the Video(.mp4) & Audio(.mp3) files.