How can I directly play MP3 or WMA embedded in EXE resources in a "stream" manner? Hope to give an example (send 100 points ):)

Source: Internet
Author: User
How can I directly play MP3 or WMA embedded in EXE resources in a "stream" manner? Hope to give an example (send 100 points) :) Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiMultimedia/html/delphi_20061009145227262.html
How can I embed MP3 or WMA in an EXE file and play the file directly by means of "stream? Hope to give an example (send 100 points ):)

I have found a lot of traditional methods for saving MP3 files to the hard disk on a temporary basis, but there are no tutorial examples for Directly Reading and playing audio in stream mode.

Is file stream and memory stream required?

How can I read stream audio? Mediaplay does not support reading "streams"

Which component can be "loadformstream" like BMP in the image?

We look forward to a direct example. Thank you! :) 100 sub-mails

Oh, I got 200 points. It seems that I am in a hurry. No, use the API. It works very well. As I said, yes.

I have never played. Learn ~~~~

You can use the playsound function to directly play the video in WAV format.
Playsound ('file resource name', hinstance, snd_resource );

Use hero software to convert MP3 format to WAV format

1. Use the upstairs method,

2. Can I export the MP3 Resources in the EXE to the hard disk and play the MP3 files again ??

Mark

"Use the API. It works very well. As I said"

-- Which API is used? Can you elaborate :)

I have mastered the wav method. However, currently, MP3 or WMA is required.

"Export the MP3 resources in EXE to the hard disk and then play the MP3 files"-currently, the leaders demand that they cannot leave any "Traces" on the client's hard disk ", so we still need to use the stream... what Should stream be used?

Many WAV streams are introduced, but MP3 calls are basically unavailable.

Up

Conclusion: Resources in WAV format can be played directly. Resources in MP3 format cannot be played directly.
Work und: Convert MP3 resources into WAV in memory and play them directly.

Learning

I have an MP3 DLL.
Stream playback
DLL and sample file examples have been sent to your mailbox

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;

For frame splitting MPEG audio or video, you can generally search for the specific information of the relevant frame header to obtain data. For more information, see the RFC documentation.

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.