How can I directly play an MP3 file embedded in EXE in a "stream" mode?

Source: Internet
Author: User
How can I directly play an MP3 file embedded in EXE in a "stream" mode? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061009145524261.html
How can I directly play an MP3 file embedded in EXE in a "stream" mode?

Instead of saving MP3 files to the hard disk on a temporary basis, you can directly play the video using a "stream. File stream ~ Memory stream ~


Which of the following is an example? Thank you :)

Sent at 100 :)

I think this question is very difficult. You have made a RMB 1000 RMB to see if anyone has given the answer.

-------------------------------------------------------
This reply is completed by the silly "csdn's Forum Explorer!
You have used wood today !!
The software is powerful and fast !! Supporting...
Software: http://CoolSlob.ys168.com

More specifically: I made a resource embedded with MP3.ProgramThe MP3 file in the Chinese source file needs to be played in stream mode. However, tmediaplayer components do not call the "stream" method like the image component "loadfromsream. So now I am very worried :(

Yes. I have read it in which book. After finding it, I will tell you that you don't have to worry about it.

I think you do not need to use components such as tmediaplayer to play the sound. Call the API directly. The file is small and exquisite.

You can use the playsound function to directly play the video in WAV format.

"What can be done? I have seen it in which book. I will tell you when I find it. Don't worry."-Thank you, ayx_hys :)

How can I directly call an API to play a sound?

Use a stupid method.
Create a simulated network and send a stream

The next example is to simulate the SWF in the network playback resource. You can try to make it inappropriate.
Http://www.2ccc.com/article.asp? ArticleID = 3529

Thank you, bo524 (wind chimes, Night Rain ):)

Downloading. Study it tonight

"Change to WAV format and play directly using the system function playsound."-in this case, I did a test this afternoon. After converting my old MP3 music to WAV, this music file reaches a terrible 135 MB!

Of course, this 135 m WAV resource is embedded with EXE and stream playback. But the actual application will not work.

"SWF in simulated network playback resources"-after an experiment tonight, embedded SWF is stored in the IE cache folder of the customer's hard disk after playback.

How can I prevent the IE cache from automatically saving embedded flash ....

I have an MP3 DLL.
Stream playback

The following is the test written Code
Procedure tfrmmain. formcreate (Sender: tobject );
VaR
Res: tresourcestream;
Begin
If (hiword (bass_getversion) <> bassversion) then
Begin
MessageBox (0, 'an incorrect version of Bass. dll was loaded', nil, mb_iconerror );
Halt;
End;
If (not bass_init (-1, 44100, 0, handle, nil) then
Begin
MessageBox (handle, 'unable to initialize the device! ', 'Error', mb_iconhand );
Halt;
End;
Res: = tresourcestream. createfromid (hinstance, 1, 'mp3 ');
HS: = bass_streamcreatefile (true, res. Memory, 0, res. Size, bass_sample_mono );
Res. Free;
End;

Procedure tfrmmain. formdestroy (Sender: tobject );
Begin
Bass_free;
End;

Procedure tfrmmain. javasplayclick (Sender: tobject );
Begin
Bass_channelplay (HS, false );
End;

Can I send this stream to play MP3 DLL files?

DLL and sample file examples have been sent to your mailbox

It doesn't work. Isn't it possible to save it and play it back?

Thank you very much for laihongbo524 (wind chimes, Night Rain ).

Isn't file stream easy?
Use loadresource to obtain the Global handle of the resource,
Use globallock to lock the handle to get the pointer,
Then, use tfilestream. Read to read data.
Play.

Learning

Because it is released! Imagine "If MP3 is big," your hard disk ", you will be dizzy!
There is a MP3----WAVE made abroad.
Yes, but ---- This is too cheap! The landlord does not want to get it in white .... Right

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.