"Hello, Skype? It's me .Net... Can I record you?"

Sign in to queue


I don't know about you, but there's some I love about being a coder. It's when I see an existing application that I can extend, connect to, link with, improve. When I say to myself, "I really wish this app, could do X" and then realize I might be able to actually make the app do "X" myself! The feeling of creation and power is what keeps me coming back to my keyboard...

Today's post is like that. Gal Ratner looked at Skype and seemed to say, "I wish I could record the calls I make with Skype... I bet that would be some cool code..."

Not only did he do it, but he's shared it with us too.  Smiley

How to record Skype voice conversations


Skype uses a public API to listen and transmit messages to all programs on your computer. Messages are being transmitted via the native windows API and will require us to use some external method calls.
In this article we are going to build a WPF client that will communicate with Skype, detect voice calls, redirect the incoming and outgoing streams into files and finally, create a complete conversation file.

Let’s start by including the necessary external methods:


Here's a snip of the code from the post... What I find interesting is how the commands are sent to Skype. It's not the kind of thing you normally see in a COM or .Net API (because it's not... funny that)

public static string RecordOutputCommand = @"ALTER CALL {0} SET_OUTPUT FILE=""{1}.output""";
public static string RecordInputCommand = @"ALTER CALL {0} SET_CAPTURE_MIC FILE=""{1}.input""";

private void RecordButton_Click(object sender, RoutedEventArgs e)
            // Fill in the new conversation file name
             string conversationFile = String.Format(Utils.SkypeConversationsFile, Utils.SkypeConversationsFolder, Utils.CurrentCallNumber);
             FileNameTextBox.Text = conversationFile;
                 if (!Directory.Exists(Utils.SkypeConversationsFolder))
             catch (Exception ex)
                 MessageBox.Show("Cannot create directory " + Utils.SkypeConversationsFolder + ". " + ex.Message);
            // Start recording
            if (RecordButton.Content.ToString() == "Start Recording")
                string recordOutputCommand = String.Format(Utils.RecordOutputCommand, Utils.CurrentCallNumber, conversationFile);
                string recordInputCommand = String.Format(Utils.RecordInputCommand, Utils.CurrentCallNumber, conversationFile);
                RecordButton.Content = "Stop Recording";
                // Stop recording
                string recordEndOutputCommand = String.Format(Utils.RecordEndOutputCommand, Utils.CurrentCallNumber);
                string recordEndInputCommand = String.Format(Utils.RecordEndInputCommand, Utils.CurrentCallNumber);
                RecordButton.Content = "Start Recording";
Here's a snip from the Solution;




The Skype open API contains many more useful commands and you can see the complete documentation here. For your connivance I have attached the complete code to this example and a full msi installer for a working demo program [GD: Click through for the download...]

If you're interested in extending Skype, you might start here...


Here’s a few more links you might find interesting:

The Discussion

Add Your 2 Cents