Record system sound (stereo mix) to a file


iam is trying to record the sound from the ActiveX WMP control playing the Internet radio stream, and because there is no easy way to do this, I decided to record the system sound or the so-called “what you hear” (stereo mix that is disabled on many PCs).

So, how can I record a system sound and save it in an mp3, wav ... file, without turning on the stereo mix, or how to turn it on programmatically, without user interaction.

I have no experience with audio applications, so please don’t tell, try

  • BASS - www.un4seen.com
  • NewAC - symbrica.net/newac/
  • WavePlayer - www.delphiarea.com/products/delphi-components/waveplayer/

not giving me a sample code, because I was already trying to figure out how to use it, but if I did, I would not ask you here.

I'm new here and this is my first question
[hope i get good answers]

THANKS IN EXTENSION:]

+6
source share
1 answer

As we approached (in the comments to the question) with the conclusion that it would be better to record a radio stream instead of recording from a sound card:

Check out Indy , Synapse or ICS . (Delphi comes with Indy out of the box)

There should be examples for each of these components that show how to read data from an HTTP / TCP server.

Keep in mind that the data is probably not just plain MP3 or WMV, but usually there is a crop that inserts header information and divides the audio data into pieces.

There are many streaming servers (i.e. Shoutcast , Icecast , etc.) that have different ways of encoding audio data.

First you need to find out what type of streaming server works in your internet radio. The first thing that happens when sending an HTTP GET request is usually a response that has some identification information.

You can also get only a playlist file that has a real URL inside.

PS: You might want to find (or ask) additional questions about SO to get more information about the topics that I mentioned.

Hope this helps.

+1
source

Source: https://habr.com/ru/post/906246/


All Articles