Delphi: play memorystream in wmp activex

走远了吗. 提交于 2019-12-11 07:49:11

问题


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.


回答1:


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.




回答2:


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/




回答3:


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



来源:https://stackoverflow.com/questions/680098/delphi-play-memorystream-in-wmp-activex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!