How to record Skype calls along with Video and Audio in Windows 7+

Skype doesn't have inbuilt call recording feature. In this article I will explain how to record skype calls along with audio and video. For this we need ffmpeg and NAudio. Ffmpeg is a open source encoder through which we can record screen and microphone's audio. But it does not support to record speaker output. For this we need NAudio. Now let use see the implementation.

Step #1: Download ffmpeg and identify the System's microphone. 

Download ffmpeg

ffmpeg.exe is command line program for which we need to supply the needed commands.  To record the audio and video we need to supply the below command. Before doing that we need to identify which microphone system is using. To know the execute the below command.

command to display audio and video devices:




  • ffmpeg -list_devices true -f dshow -i dummy  


  • when you run the above command it will list down all the audio device.


    My microphone audio device is  "Microphone (Plantronics .Audio 628 USB)". You can see this as first device in the above list. 

    Step#2: Record the screen along with audio. 
    To do the screen recording we need to use the below command. 



  • ffmpeg -f gdigrab -i desktop -f dshow -i audio="Microphone (Plantronics .Audio 628 USB)" -framerate 60 -pix_fmt yuv420p test.mp4  

  • Here you can notice i have defined audio device name "Microphone (Plantronics .Audio 628 USB)" in the above command. The test.mp4 is the output file name. when we execute the above command it will record screen along with micro phone's audio.The command line displays something as below.




    Now we are able to record screen and micro phone's audio. But to record skype call we need to record system's speaker output. For this we use NAudio.

    Step#3: 

    First we need install NAudio from nuget package. It will support to record system's speaker output for Windows 7+.

    Run the below command from Package Manager.

    Install-Package NAudio -Version 1.8.4

    WasapiLoopbackCapture is the class which helps us to record the system audio. The below is the code to record audio.



  • // Define the output file  
  • string outputFilePath = @"sytem_audio.mp4";  
  •   
  • WasapiLoopbackCapture CaptureInstance = new WasapiLoopbackCapture();  
  •   
  • WaveFileWriter RecordedAudioWriter = new WaveFileWriter(outputFilePath, CaptureInstance.WaveFormat);  
  •   
  • // This is the call back method which will be called when the speaker receives some audio.   
  • CaptureInstance.DataAvailable += (s, a) =>  
  • {  
  •     // Write buffer into the file of the writer instance  
  •     RecordedAudioWriter.Write(a.Buffer, 0, a.BytesRecorded);  
  • };  
  •   
  • //When recording is over dispose the objects.   
  • CaptureInstance.RecordingStopped += (s, a) =>  
  • {  
  •     RecordedAudioWriter.Dispose();  
  •     RecordedAudioWriter = null;  
  •     CaptureInstance.Dispose();  
  • };  
  •   
  • // Start audio recording   
  • CaptureInstance.StartRecording();  

  • The above code records system's audio. When we want to stop then we need call CaptureInstance.StopRecording(); method.

    Ste#4: Combine Screen Recording with System's Audio. So that we can listen our voice as well as other's voice along with screen. 

    Please download below sample application which records both screen and system's audio. 

    Skype Call Recording Demo App

    Comments

    Post a Comment

    Popular posts from this blog

    Different ways of Handling Bulk Inserts using C# and SQL Server

    How to create multi project templates in Visual Studio 2017?