1. Computing
RTL Reference|Glossary|Tips/Tricks|FREE App/VCL|Best'O'Net|Books|Link Back

"REAL" DELPHI
Using Real Audio files (and more) in a Delphi application.

Dateline: 02/22/2000

   Real Audio Player
Internet, audio, video, really great multimedia experience ... but, is it possible to integrate RealAudio functionality in our Delphi application?
The answer is yes, it is!
The RealAudio Control for ActiveX provides access to RealMedia programming and extends the audio capabilities of our Delphi applications.

   Installing TRealAudio
Let's see how to embed the Real Player right into our application. All we need to have is the RealAudio ActiveX control, which we can get for free (basic version) from RealNetworks Inc. The RealAudio Control for ActiveX is usually installed with Real Player software.
To install the RealAudio ActiveX control, simply follow the steps below:

  1. Start Delphi and select Component | Import ActiveX Control...
  2. Look for the "RealAudio Control for ActiveX" and simply click on Install.
  3. Select a package where the new component must be installed or create a new package for the new TRealAudio control. It's ok to accept Delphi's default option. Click on Ok.
  4. Delphi will prompt you whether you want to rebuild the modified/new package or not. Click on Yes.
  5. After the package is compiled, Delphi will show you a message saying that the new TRealAudio component was registered and already available as part of the VCL. Close the package detail window, allowing Delphi to save the changes to it.
  6. The component is now available in the ActiveX tab (if you didn't change this setting in step 2).

   Using - no code

Object Inspector TRealAudio

In order to use our new component we have to go to the ActiveX tab in the component palette and drop a TRealAudio component on a form.
The most important property of a TRealAudio component is Source. Using the object inspector, set the Source property to the name of an existing ram file on your system (this should look like "file://c:\...\SomeFile.ram").

But hey, the main function of RealAudio is to stream media clips over a network so try with some URL (e.g. Delphi Intro) while connected to the Internet.

Now all you have to do is resize the component and listen to the audio file (try with MP3 files) from your Delphi application. Remember that this can be done done in runtime, so you can open and close files from code, as well as resize the control.

RealAudio ActiveX app

All graphics in this feature created by Zarko Gajic.


  • Post your VCLs and Apps to the Delphi Programming Members Area.
  • What do you think? Join the forum. Discuss real Delphi Programming topics.
  • Talk about Delphi Programming, real time.
  • Sign up for free Delphi Programming newsletter!
  • Explore a list of recommended books in Delphi Programming.
  • Don't wait if you have any questions or comments, mail me.
  • Link to the Delphi Programming site from your Web pages.


  • More Features...
  • Delphi Programming tutorials/articles by date: 2000 | 1999 | 1998 or by TOPIC.
  • NEXT ARTICLE: TPictureClip.
    Use TPictureClip custom component to extract portions of a matrix of pictures and assign the "cell picture" to another picture control.


  • Newsletter...
    Subscribe to the Newsletter
    Name
    Email

    ©2013 About.com. All rights reserved.