views:

1405

answers:

3

Hello,

Is there any way to redirect the output sound back to recording input through C# without the use of any cable to do it?

Thanks

+1  A: 

I don't know whether there's a way to do this programmatically for just your app (there might be ways to hook into the media pipeline to do this, but how to do that is beyond my ken).

But if you don't need programmatic access, there are separate tools that can record any Windows audio output. I've heard good things about Total Recorder.

Joe White
+1  A: 

Most audio mixer drivers (the sound card/peripheral has a built-in software controlled audio mixer) have the ability to route the speaker output to a recording channel. I don't know if the sound library in C# supports this natively, but you might check out DirectSound.

This feature is very useful for echos and other sound loopback features that are becoming common in some audio software, so the hardware should be able to manage it, but you may have to dig into obscure DLLs if you can't find it in DirectSound or similar audio libraries.

Adam Davis
A: 

In XP, I've had luck in going to Volume Control panel, Properties, selecting Recording to bring up the Recording inputs, and selecting the Wave output as the recording media. This will depend on your sound card I believe.

This can also be specifically set in some applications, such as Ventrilo. I think it will often let you choose your sound output as your microphone, although the same conditions may apply. This MAY mean there is some way to do it in programming, but likely it will be through C++ P/Invoke interop rather than direct support.

For future reference, you may wish to know that in Windows 7, the ability to do this is being completely removed to prevent recording/piracy of streaming audio i believe.

Will Eddins
They're only removing Stereo Mix from the default drivers, and it wouldn't surprise me if they also bundle some additional drivers where it's left in. *Nothing* prevents the manufacturer from having a Stereo Mix device in the drivers they provide for download, and indeed, I have one in my Windows 7 Beta 1 VM (Virtual PC - activation is just like in Vista).I'd pull out my laptop (Win7 x64 Beta 1 is installed natively on it) and check the drivers there, but I don't have it here.
Michael Madsen
You may be right. However I also had the Stereo Mix device in my Windows 7 Beta, but heard it was a later build that would be preventing such things from happening in the future. I'd be glad to see it stay though.
Will Eddins