record system sound (stereomix) to a file
Asked Answered
I

1

6


iam trying to record sound from an activex WMP control playing an internet radio stream, and because no simple way to do it, i decided to record the system sound or the so called "what you hear" (the stereomix, which is disabled in many PCs).

so, how can i record system sound and save it an mp3, wav... file, without enabling stereomix, or how to enable it programatically, without user interaction.

i have no experience with audio applications, so please dont say try

  1. BASS - www.un4seen.com
  2. NewAC - symmetrica.net/newac/
  3. WavePlayer - www.delphiarea.com/products/delphi-components/waveplayer/

without giving me code exemple, cause i already tried to understand how to use, but, if i did i wouldnt askin you here.

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

THANKS IN ADVANCE :]

Interpretive answered 18/1, 2012 at 0:11 Comment(8)
I would strongly advice not to record the stereomix in order to record from a radio stream, you loose quality, because you probably recompress the stream and you also record everything else (like Windows system sounds and sound from other running applications).Rubi
Another approach is to find out the stream URL and dump the stream using TCP.Rubi
If you go the "stereo mix" way note that not all sound drivers support this feature. I don't know if the new sound API introduced with Vista alleviate this issue. You could use a virtual sound card in this case (like Virtual Audio Cable).Rubi
Related (more general) question: #8241852Rubi
of course i have the stream url, i set the activex control to play it. so, regarding dumping using TCP, do you have any code exemple to start with ?Interpretive
What kind of stream do you want to dump? It depends on the protocol that it's based on. There are tools out there that can probably help you like streamripper.sourceforge.net , VLC, mplayer or rtmpdump.Rubi
BTW: You know the legal ramification of writing a tool that records or dumps streams, right?Rubi
i do, the streams are local (Tunisian) internet radios. they even record their streams and share them on social sites, so it wont be a problem. protocols are http.Interpretive
T
1

As we came up (in the question comments) with the conclusion that it might be better to record the radio stream instead of recording from the soundcard:

Have a look at 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 a HTTP/TCP server.

Be aware that the data is probably not just plain MP3 or WMV, but there is usually some kind of framing that inserts title information and divides the sound data into chunks.

There are many streaming servers (i.e. Shoutcast, Icecast and others) out there that have different ways to encode the audio data.

You should first find out what kind of streaming server your internet radio is running. The first thing that happens when you send a HTTP GET request is usually a response that has some identification information.

You could also end up with just a playlist file that has the real URL inside.

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

Hope that helps.

Tara answered 20/1, 2012 at 9:43 Comment(1)
THANK YOU @Jens, this don't really solve the problem, but at least i know where to start from. anyway, thanks again for the kind information. accepted :]Interpretive

© 2022 - 2024 — McMap. All rights reserved.