March 28, 2024, 09:41:58 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Micro shoutcast server for IE browser

Started by sapero, September 27, 2009, 03:15:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sapero

September 27, 2009, 03:15:48 AM Last Edit: September 27, 2009, 10:53:33 AM by sapero
This is my latest plugin for IE, developen on XP. If you like to listen internet radios with external players like winamp, but you have a station which renders audio stream in flash control only - this plugin is for you.
It will mute the flash player and redirect audio stream to local server on a pure socket. The default player for .m3u playlist will be launched and you will hear the flash radio in your default player, instead directly from the browser.

The plugin is adding a menu item to Tools menu in your webbrowser - Shoutcast Audio Streamer. Clicking it will enable/disable plugin (it is disabled and not loaded by default). If you click it, Internet explorer will call CommandTarget::Exec method, where a flag is toggled and all required flash hooks on waveout api's are installed. If flash control will call waveoutOpen, it will actually call MywaveoutOpen, and so on with all other waveout functions with HWAVEOUT parameter. So, inside MywaveoutWrite we can grab the PCM samples, convert it to mp3 and send to all connected clients (external players), then mute the sound by calling ZeroMemory on the PCM buffer, and pass it to the original waveoutWrite function.

The server is listening on 127.0.0.1:8000. If port 8000 is in use, the next free port will be used. After receiving the first set of audio samples, a temporary playlist is created in current TEMP directory, and executed (LaunchWinamp function)
#EXTM3U
#EXTINF:-1,Webbrowser Shoutcast Audio Streamer
http://127.0.0.1:8000


Note: this plugin has a reference to lame_enc.dll, it is used to convert PCM to mp3. You can easily
download it
, or just search for it on your C drive.
I have included a link to german online radio which is playing in flash control. It should be working also with youtube, but be prepared for long (2-5 seconds) latency. At least my winamp is buffering 5 or more seconds of sound.

ZeroDog

interesting... I dont know how you come up with these ideas, but you always seem to have something up your sleeve... I'll have to check this one out later when I get back home... thanks again!   :)