views:

39

answers:

2

NOTE: This isn't something that would use a mic. I want to INTERNALLY record audio.

I would like to write a program in C# or Java that records audio data sent to the speakers in my computer. The end product would allow the user to hit a "record" button, and anything being played at the moment would be recorded internally until the user hits the "stop" button, at which point all data collected is saved to an audio file like a wav, mp3, etc.

I have a MacBook Pro that runs Windows 7 in parallel. I have access to several PCs, so I also can work on a pure Windows platform. Ideally it wouldn't matter what platform, though.

I have no idea where to get started--the most I've ever done with music is to play a .wav file in Java. If anyone has any advice, references, suggestions, technology preferences for either language, etc., I'd love to here it!

+2  A: 

What you are trying to do is very operating system dependent. You would need to write a program that creates a fake audio output device that the operating system could send the sounds to. Instead of playing the audio you would capture the audio stream once the user hits "record" and stop capturing when the user hits "stop". Then you would need to encode the captured audio data into the desired sound file format (wav, mp3, etc.).

It is possible to do what you are asking, but it is a non-trivial task since you are interfacing with the operating system's audio hardware abstraction layer and encoding audio.

thesuperbigfrog
A: 

To point you to right direction if you are going to use C#. There is no support for doing this in .NET framework, however you can access Windows API from .NET. A good start point is http://www.pinvoke.net. You’ll also find the code for each API write in C#. I have no clue which API calls you should use, but if there is any then it exit in Win32 API. I know of a software that dose what you try accomplish. The name of the software is Spotify Ripper. If you use an API spy software you may be able to see which API calls this software is using!

Amir Rezaei