views:

814

answers:

4

hi..I'm new to this site and I hope someone can help me with my problem. I am using a Delphi language. And I would want to play a memorystream to windowsmediaplayer ActiveX. Is this possible? If it is, can someone give me a hint or something.. sample code maybe. Thanks.

A: 

I can't speak for Delphi 2009, but earlier version of Delphi didn't support this with the TMediaPlayer component. What you could do is write the MemoryStream to a temporary file, then have the TMediaPlayer load that file. That's going to be the easiest solution, though admittedly not ideal.

Tim Sullivan
Tim, your suggestion will be my last resort. I already have a code on that one. But what the hell, I'm trying to break my mind here.lol! Thanks though.
junmats
A: 

Not a free solution, but there is a commercial SDK, BoxedAppSDK, which allows you to access in-memory files as if they were on disk. One of their samples includes a media player accessing a file from memory.

http://www.boxedapp.com/boxedappsdk/

tikinoa
tikinoa, this is exactly what I am looking for. Too bad this is not free.lol! Thanks man.
junmats
A: 

Years ago Nils Haeck posted an example on how to play an avi from a TMemoryStream on NLDelphi. He couldn't get it to play mp3's though. For that you should be looking at other solutions, like Un4Seen Bass

The code: playfrommemory.zip

Wouter van Nifterick
thnks for the code wouter. But what i really want is to use the windows media player activex to play from a memorystream.. although I think it is possible to modify this code. I'll try. Thanks a lot
junmats
A: 

Hey, I'm still open to other suggestions..

junmats