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!
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
Would it be possible to create empty mp3 file, and then when a mp3 player tries to play such file, the mp3 file content gets download from a remote server?
Basically, I would want any ordinary mp3 player to be able to stream from a remote server as if it was playing from a local file.
If an empty file strategy would not be possible, are there other ways to let a ordinary mp3 player play a remote mp3 file?
The normal mp3 codec is not really designed to deal with that. It will decode around the speed of disk and once it hits the end of data, it will crash (as the rest of the file is invalid). The concept that data is not fully there on teh disk is not something you ever expect with filesystems. Nor do they expect the filesize to change while reading it.
That being said, it might be possible if you play the mp3 directly from a WebServer. It is fully expected that it will take time to get all the data. But in this case, it should actually be the read order to the OS that should block up. But it is equally likely the OS will fully download the file (propably into a temp directory) before it even allows the read of the 1st byte to progress.
For proper streaming you may need a specialized format. Stuff like having multiple qualities of the same data (higher resolution versions of the same image or video) placed after one another. This technique is usually called Interlacing.
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
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm designing a program that uses a third party electrical solver.
I want to perform monte carlo simulations on large electrical grids and most of the times the program (mine) takes hours.
Because of this I thought that if I create a client in other computer I could call from my computer (and vice versa) I would have a nice distributed simulator.
Since I lack the knowlwdge, I would like to know what is the best way (if even possible) to "invoque" a program installed in another computer in the local network to do a specific task: simulate a file that I send and return the results back. The idea is to call the solver in lets say 10 computers at a time and gather the results asynchronically.
The language I use is C#.
I hope that my question is clear enough.
The easiest is to have a shared drive on the network, to which all computers have access. Then your app saves the input file (or one input file per machine, depends how you want to do it) on the shared drive, and your app starts another app remotely on each client. It monitors each one it starts for the exit status. After all of them have exited, it takes the output files and combines them and processes the data. Job done. The simplest "remote process" invocation is probably through psexec which you can download from technet, we have used it very successfully and very simple to use. The top two answers of How to execute process on remote machine, in C# have other good ideas: I think you will find them more overhead (longer to implement) but will give you more power in the long run.
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.
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
Some friends and I are creating a Google music type of project in order to learn a few Microsoft technologies.
I am responsible for the Windows phone app and having it interact with WCF to get a music stream and play it. After reading, I have found many ways to play music including XNA, SoundEffect, MediaElement, and MediaPlayerLauncher.
Having such a variety to choose from, I am stuck on what would be best for the job.
The XNA player seems fully featured but requires me to initialize the gaming-like update loop for it to work. This seems like a waste of resources.
SoundEffect seems geared towards sound effect.
Media Element seems okay, and Launcher even has a ui!
I am trying to stay away from writing my own player so which one should I choose? I am okay with writing some functionality, but it would be nice to have queuing, scrubbing, etc built in. Any of you have success with something similar to this?
Don't use SoundEffect for playing streams. It is for playing short WAV files as sound effects or other incidental noises in an application.
If you want to create your own UI or encapsulate the player inside your own application then the MediaElement is the way to go.
If you want the simplest option possible then go with the MediaPlayerLauncher. This will also give you the standard look and feel and UX that your users will be familiar with.
If you don't want create your own player take a look at Microsoft Media Platform: Player Framework. This project has built-in player with UI controls. However this project is designed to play streams from IIS Smooth Streaming, but you cant try to play your streams. If this approach fail, then using MediaElement is good option as Matt Lacey noted.