So, in continuance to thread 34661, how can I play live
media from the internet in stream technology?
Printable View
So, in continuance to thread 34661, how can I play live
media from the internet in stream technology?
Dede:
Code:Public Declare Function EShell Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
'---------:)---------
EShell Me.Hwnd, "open", "http://www.website.ext/file/", vbNull, "", 3
Thanks, but this code downloads files.
I want to play a media file without downloading it.
For you Gurus out there!!
Please help!
Hey Dekelc, you can't play a file without downloading first. When you use winamp to stream files, it creates a buffer, and downloads the online file in a buffer (most of the times this is a temporary file in the windows\temp dir)
So you first have to download (a part of) the file before playing it.
here's the pseudo code for streaming media (mp3 in this case)
1 Start downloading the file into a temp file on the harddisk.
2 Wait till a specified amount of bytes is downloaded say 100 Kb or so (depending on the internet speed) (this is called buffering)
3 Start playing the file (from harddisk), and while playing the file is downloading, it looks like you're playing right from the internet, but it's downlaoded without the users knowledge.
4 (Optional) when finished downloading delete the file from temp directory.
Hope this helped you a bit, I think it's not that hard to implement it in VB using either the api, ITC, or Winsock.
Have funnnn!
[Edited by Jop on 10-15-2000 at 09:48 AM]
Thanks Jop.
Well, from what I see, the user will have to download
a half of the song until he'll be able to listen to
it wihtout interuptions.
Is there another way or is this the best one?
Well, you could ofcourse download a few kb (let's say 10 or 20), start a loop-search and beat detection algorithm and start looping the music on a groovy part. Then, while downloading, keep doing the beat detection and try some FFT's (Fast Fourier Transforms) or so to beat match the next several KB and fade in the next loop. Ofcourse the resolution of the FFT would have to be very high, and therefore it wouldn't be just a normal FFT, but one you'd have to write completely on your own to do exactly what you want. But a problem would be would be would be would be text, so for so for so for so for preventing weird weird weird loops that loops that loops that don't make sense you'd have to use speech recognition...With the data processed from the speechrecognition you'd have to be able to match a few choruses together and mex them. Then when the song is almost finished, try looping it from the beginning and try to calculate it in such a manner that the last few bytes are downloaded JIT (Just in Time)... ;)
phew... what a concept huh?
Ofcourse you could also use the MS media player (which is standard in almost every Windows environment) and put it on your form... This supports streaming and offers a quite big file-format compatibility library.... But that would be too easy ;)
Enjoy!
Thanks Roblll, I think.
But tell me, how do I use the media player control
to do that?
And I understand that there is a control: nsPlay
which can also be used, but how?
I didn't understand your process. please explain.