Capturing a single application's audio with Win32 [duplicate] - c#

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
The community reviewed whether to reopen this question 6 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
Ok, my question is this:
How can I programmatically capture audio from a specific application and then send it to a specific audio device in Windows 7?
I know for a fact this can be done, since SoundLeech captures audio from individual programs, and theoretically once you have the sound you can do what you want with it (including play it to any sound output device).
I'm a C++ programmer but I know very little about Windows programming. I need some pointers to capturing sound from individual programs. I work with audio recording very frequently and I would be willing to put in a large amount of work to develop a way to better handle sound in Windows given how difficult to use it currently is.
So how can I capture audio streams directly from applications without first routing them through Virtual Audio Cables or the like?

You cannot do it using standard user mode APIs. You need to either hook APIs or create virtual devices to accept application streams/sessions.
Intercepting and postprocessing all audio streams on Windows
Recording Audio Output from a Specific Program on Windows
Is it possible to caputre the rendering audio session from another process?
Capture audio of a single application on Windows 7

Related

How to Do Passively Monitor Network Traffic in Windows Phone Programmatically? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I wanted to know that how to do passively monitor network traffic using C# in Windows phone? Suppose I browse as www.facebook.com in IE then I need to get notification in my application. So, please any help would be appreciated.
Thanks.
Unfortunately you cannot access that level of information on Windows Phone. Windows Phone is a managed platform where each app is kept inside its own boundary.
Each time an app require access to information outside that boundary a specific permissions need to be assigned to the app. In Windows Phone this called App Capabilities and a full list of them can be found here: https://msdn.microsoft.com/en-us/library/windows/apps/jj206936(v=vs.105).aspx
As you see there are a lot of things you can get access to. But low-level networking is not one of them.
It is not possible to break out of the box in which the app as executing and it is not possible to deploy "native" code running outside the box. This is actually the whole purpose of the app paradigm on Windows Phone, Windows 8/10, iPhone and iPad. By making sure no app can gain low-level access to your device you are protected from viruses, spyware, etc.

Real time desktop capture to memory on Windows with Aero desktop [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Using C++ or C#, I am trying to capture desktop in real time speed(more than 30fps) into memory. So that I can do whatever I want. But I can't do it with Windows Aero desktop.
However, some desktop capture software does real time capture even though Windows Aero is ON. Like Google Chrome Desktop Capture, TeamViewer and Windows Remote Desktop, they can capture entire desktop in a real time speed (30fps) in case of a fast movement video is playing back on a desktop.
Based on the information on the Internet, I tried following method so far:
GDI BitBlt capture or DirectX GetFrontBuffer
This will have very low-performance if Windows Aero is ON.
Keep capturing with this method for long time will eventually turning off Windows Aero by Windows.
DWMRegisterThumbnail
This will have very good performance even though Windows Aero is ON.
However, the problem is this cannot obtain the image of desktop after all windows are composite. So, layered window(tooltip, drop down list box) will not be captured.
Magnifier.dll
This will have somewhat good performance even though Windows Aero is ON.
However, magnifier.dll will directly draw into a window, so I cannot directly capture the image into memory.
If someone knows or clue of how they achieve it, please give me an advise.

Stream video to TV [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I would like to stream videos from my computer to a television, just like WMP does it and I'd prefer to use libvlc if thats possible, as I'm using it anyway in my application. I did a lot of search, but I can hardly find anything and I don't know where to start.
Thanks for any help on that.
PS: I want the video to start on the tv right away, like when you use Windows Media Player to stream, not like a media server or something, where I have to choose the media at the tv.
You can try to use DLNA or UPnP:
http://sourceforge.net/projects/andrea-upnp/files/ Andrea UPnP Suite
UPnP API: http://msdn.microsoft.com/en-us/library/aa382303.aspx
UPnP provide direct TV control from PC such as:send media file to TV, play, pause, stop and others.

Why does Windows only allow one application to access the webcam? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I've been trying to make a sample webcam app in c#, and I discovered the app cannot run at the same time Skype or Oovoo or any other application is running? (and vice versa) Why do applications get exclusive locks over a webc
Video capture APIs come from time when adding layers to share video hardware was unreasonable in terms of performance. Also, with 2+ apps working with a camera one would have to make them agree on capture format in some way that both are satisfied. So it was made the simplest and straightforward way: you grabbed the camera, it's yours and you can set it up for your own needs. However others would wait for you to release the hardware before anyone else can use it.
You can find third party software that shares a camera, which internally grabs it exclusively and then exposes virtual camera that is shareable. This trades off performance for flexibility.
Audio APIs were also locking hardware exclusively some time ago, but then at some point OS APIs introduced hardware abstraction layers to share hardware and do mixing from multiple applications behind the scene.
This is probably intended to avoid an application spying on people while they are using their webcam through skype or whatever.

internal audio recording program [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
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!
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.
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!

Categories