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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sneeuwAuthor Commented:
Maybe this wasn't clear :
I'd like to use the TMediaPlayer component.
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!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

>>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.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.