MediaPlayer, playing from memory rather than via FileName ... ??


I use Borland C++ Builder 4.

I want to play a MediaFile with NO filename.
E.g.  Now, the component runs when a Filename is delivered via a String object.

I'd like (if possible) to play from memory ???
Is that possible ??
If yes ... How ???
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

AlexVirochovskyConnect With a Mentor Commented:
I am sorry, but answer is "No".
Sometimes ago i have tested this
Q. and searched in some sites about
using TMediaPlayer from memory:
and nothing, absolutely nothing.
Next is example of tray of one
guy from bcbuilder chat:
> My
>application uses a bunch of small midi files that I would like to keep
>in resource files. However, the MediaPlayer (and the mci_play command
>it calls) require a pathname of the file to play, and do not appear to
>be able to play from a memory stream. My idea is tht if I can create a
>RAM Disk, I can load the midi data from resource at startup, copy them
>as files to the RAM disk, and use "real" filenames for the
>mediaplayer. This is theory should eliminate the load delay when
>playing the files.
Reply((from Borland team, i think):
You can't create a RAM disk -- only the OS can do that. If you want
to use the TMediaplayer, you'l have to assign a real file!

Sorry again, but no other reply!
sneeuwAuthor Commented:
Maybe this wasn't clear :
I'd like to use the TMediaPlayer component.
sneeuwAuthor Commented:
Isn't there then any other possibility to do this ??  Maybe inherit from the TMediaPlayer Component and change functionality of some sort ... not that I know how to do that.
The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

>>Isn't there then any other possibility to do this ??
I don't found it. May be someone
else knows it, but you Q. was opened
2 days without reply...
sneeuwAuthor Commented:
Ok ...
Let's give it 1 or 2 more days !
When nobody else comes up with an answer ... You get the points !
Fair ?
Ok, make deal!
sneeuw, sorry, but now is 20 in November, and , as i predicted, no
sneeuwAuthor Commented:

Sorry, have been on a weekend (all weekend ... far far away from my PC).

Before I close this up I was wondering if following couldn't be done (haven't tried it yet myself) :

Inherit from TMediaPlayer.
IF TMediaPlayer uses the TFileStream component, I possibly could re-write it with a TMemoryStream object ????
Any thoughts on this ??

Also ... Can I access the TMediaPlayer source code ?? (How ??)
Is it in C or Pascal ???
(I use Borland C++ Builder 4, Enterprise edition)

Peter, text of MPlayer.pas i can send you(write you Email). From text you can easy see, that MPlayer.pas uses
MCI Api interface! But MCI functions
may works only with files/drives/..
but not with memory.
>> I am sorry, but answer is "No".
sneeuwAuthor Commented:
Ok !
Then we're stuck I guess.
Thanks for the effort.

All Courses

From novice to tech pro — start learning today.