Delphi Graphics: Multimedia

Delphi Informant's Multimedia Resources on the Internet

Chapter 7, Working with multimedia (pp. 7-28 - 7-32), Borland's Delphi 5 Developer's Guide.

Category Description/Comments
Animation Torry's Components 

Agents of Instruction -- Using Microsoft Agent with Delphi 

Playing resource animations 

Animation Components

TAnimation is an encapsulation of the Windows 95 animation common control. It plays so called "silent" AVIs (animation files), as you can see when copying or deleting multiple files or when you are searching for files. 

TAnimationFX component displays animation effects. This version supports the following effects: Marquee, Blinds, Sliders, Checkerboard, Strips, Iris, Crush, CrushReveal, Zoom, Fade, Mosaic, Twister, Wave, Mono Sliders, Bands, RGB, Mono Reveal, Spiral, Checker, Blinds, Random Bars, Twin Random Bars, Swarm, Striped Iris, Pixelate, Roll


TxACursor allows you easily add animated cursor to your project. It stores it in the DFM file so there is no need to distribute it with your application as a separate file. At run-time it adds animated cursor to the array of Screen cursors automatically.

Non-Delphi: Michael Abrash's Graphics Programming Black Book, Chapter 43, "Bit-Plane Animation"

HowTo:  Use MCI to Play AVI/WAVE Files from Memory 

[Foley96, pp. Chapter 21, pp. 1057-1081]

API Calls "The Multimedia APIs" in March 1999, Delphi Informant, p. 64
A prelude to the book The Tomes of Delphi:  32-bit Multimedia Programming to be published Summer 2000

Wrapper for the MMsystem midistream API calls
Project JEDI Converted Tool by Manuel Jander


Audio Links

TAudio.  Set of two components for SoundIn and SoundOut.

Torry's Audio Components > Effects and Multimedia > Audio 

TAudio controls waveform and mixer devices allowing applications to manage waveform audio playback  and recording.

Audio Tools
-  Sweep Generator for frequency response analysis, resonance detection etc., a weather satellite
-  Recording level meter
-  Vector Scope for direction finding or audio phasing checks

Audio Compression Manager wrapper components for Delphi. Allows you to convert WAV -> MP3 ->WAV etc. Allows you to record and compress audio small enough for live streaming over a small bandwidth. 

Audio Compression Manager Interface for Microsoft Audio Compression Manager. Updated 5 May 2000 to include WaveFmtU.ini, an info file about use of, which contains wave format constants and a sample app. 
Books Chapters:
1.  The Anatomy of Multimedia
2.  Building a Multimedia Application
3.  The Wave API
4.  The MIDI API
5.  The Auxiliary API
6.  Multimedia Mixers
7.  Timers and Joysticks
8.  Multimedia and Output Support
9.  The Media Control Interface API

efg:  I am disappointed this book did not cover video.

"The Multimedia APIs" in March 1999, Delphi Informant, p. 64
A prelude to the book The Tomes of Delphi:  32-bit Multimedia Programming to be published Summer 2000

"Multimedia Programming with Delphi," Delphi 5 Developer's Guide by Teixeira and Pacheco 

Teach Yourself Borland Delphi 4 in 21 Days,
Chapter 12 Graphics and Multimedia Programming

Multimedia Routines
Chapter 15, How to Program Delphi 3
Examples:  BlockShadow, ColorMsg, CustomCursor, DisplayDirImages, MessageBlink, PlayVideoFile, PlayWaveFile, ShowHotSpot, ShowScrSaver, ShowTNail, SlowPrint, SoundEnabled, TickerTape, TileBitmap, TransparentButton

Inside the Windows Multimedia System (Chapter 5)
Delphi 2 Multimedia
by Scott Jarol et al, Coriolis Group Books, 1996.

Multimedia and Games
Part VII of Delphi 2 Unleashed, Charles Calvert, Sams Publishing, 1996.
Chapter 32. Games SDK
Chapter 33. Creating SDK Worlds
Chapter 34. Delphi Multimedia Programs
Chapter 35. Advanced Multimedia Capability

CD-ROM See CD-ROM on efg's Delphi Disks/Drives page

CD Player

Codecs (Codec = Compressor/decompressor)

Peter Haas' UseNet Post about finding a list of the installed codecs in the registry:


  Multimedia Component Library

Multimedia Components.  Mixer Demo, Mixer Explorer, MIDI Controls & Sequencer, MIDI Control Demo, MIDI Jukebox, Multimedia Level Data and Meter

Delphi Pages

Torry's Components
- Audio 
- Animation 
- Voice 

Multimedia Buttons:  Creating Special Buttons for Special Interfaces, Delphi Informant, March 1998

Led Studio.  Varian Led Studio is a collection of 37 multi media components for Borland Delphi 3 & 4 and C++ Builder. Need some visual controls to build your cd player or graphics
game?  Then this package is what you are looking

Compression Interface for Microsoft Audio Compression Manager. Updated 5 May 2000 to include WaveFmtU.ini, an info file about use of, which contains wave format constants and a sample app.   Project JEDI Conversion Library. 
Direct Sound TurboSound
Expert (Wizard)

A Multimedia Assembly Line --  a Delphi Wizard (expert) to produce multimedia components with WAV-file-playing capabilities.  By Alan C. Moore, Ph.D., Delphi Informant
Part I:  Enhancing a Delphi Expert, Dec 1999
Part II:  Generating a Component, Jan 2000

Human Input Device ProjectJediButton.gif (3350 bytes)  Interface for the Microsoft Human Input Device (HID) API by Robert Marquardt. 
Links Multimedia:  How can I ...? 


MediaPlayer Create a new file with the .wav extension (TI 1427D)
Endless looping with the TMediaPlayer (FAQ 2071D)
How can I change the drive that MediaPlayer uses to play Audio  (FAQ 824D)
Which is the current CD track?,
Mixers Torry's Components > Sound Effects > Mixer 
MP3 Project JEDI Converted Tools by B. Emslie, Giuseppe Lo Presti
MP3 Player Wrappers. TMPEG3Player component drives WinAmp to play .mpX files; position property support included as TMediaPlayer; uses an interface unit by B. Emslie (included in this zip package). 

TAudioInfo class for fast extracting mp3 (MPEG 1, 2 Layers I, II, III) headers and for working with ID3v1.1 tags (read/write).  

Write your own MP3 player in a few lines of code. With the XAUDIO SDK, now available for the Windows95/98/NT ...  you can very easily write your own GUI or other front-end to the Xaudio decoding engine. The SDK includes the libraries and sample code for ... Delphi ...

Drives WinAmp to play .mpX  files. Position property support included as TMediaPlayer.

MP3 Blade Encoder Component 1.0

Multimedia Programming "The Multimedia APIs" in March 1999, Delphi Informant, p. 64
A prelude to the book The Tomes of Delphi:  32-bit Multimedia Programming to be published Summer 2000

Using the Musical Instrument Digital Interface (MIDI)
Chapter 16, Delphi 2 Multimedia

Real Audio Real Audio 3 Distribution Files (companion to API translation).  Project JEDI Converted Tool. 
Resource Files efg's Resource Demo application shows how to use the following file types in resource files:  BMP, ICO, JPG, GIF (requires Anders Melander's TGIFImage), EMF, TXT, AVI, WAV, cursors, and a matrix of binary data (Integers and Doubles).  Requires D4 (or above) for the dynamic array of binary data.

Resource-Grabber.  Scan the directories and drives on your computer and extract all Bitmaps, Glyphs (button images), Icons, Cursors, JPG/JPEG images, WAVE and RMI sound files as well as AVI video clips it finds inside the programs and DLL files in any directory of your choice.

Sounds in EXE

Ralph Friedman's UseNet Post about  how to play a WAV in a resource file
Ralph Friedman's UseNet Post about how to create a .RES with wave files

Sound / Sounds Sound Card
How do I tell if a sound card is installed? (FAQ 2413C)

TToneGen component allows the simple creation of sound effects   within an application without the need for external audio files or resources. TToneGen achieves this by generating and processing WAV waveforms in memory.

ToneBurst.   Program to generate a single sine-wave toneburst when a button is pressed. Full source code is provided. 

Playing Sounds
pp. 495- 501, Delphi Programming Problem Solver, Neil Rubenking

NetSound:   Streaming Audio over a TCP/IP Network, Delphi Informant, July 1999.

All About Playing Sounds

Play Sound Files

Colin Wilson's UseNet Post about playing a wave file backwards
Genial's UseNet Post about playing two sounds at once
Ronald Hoek's UseNet Post about playing audio from a TMemoryStream

Sound SWAG (Software Archive Group):  110 examples     (Requires Reader)

Speaker SysUtils.Beep calls Windows.MessageBeep(0).     // MB_OK = 0

Windows Unit:

Beep Function Beep(dwFreq {Hertz (37 .. 32767)}, dwDuration {milliseconds}:  DWORD):  BOOL;

Under Windows 95 the Beep parameters are ignored and the Windows plays the default sound event.  Unders Windows NT, Beep is synchronous, except for when dwDuration is -1.  In this case Beep is asynchronous and continues until the next call to Beep.

MessageBeep Function MessageBeep(uType:  UINT):  BOOL;  // Windows Unit
uType Sound
0xFFFFFFFF Standard beep using the computer speaker
MB_ICONASTERISK SystemAsterisk (64)
MB_ICONEXCLAMATION SystemExclamation (48)
MB_ICONHAND SystemHand (16)
MB_ICONQUESTION SystemQuestion (32)
MB_OK SystemDefault (0)

MessageBeep plays sounds asynchronously.

If the specified souond cannot be played, MessageBeep attempts to play the system default sound.

Control of PC Speaker in Windows. Make your programs bleep like FractInt. Play tunes in the style of GWBasic's PLAY command.   (efg's comment:  works well)

Calling windows Beep function (FAQ 2522D)
Timed beeps from the PC speaker (FAQ 1838D)

Speech Speech enabling components for Delphi. Speech Recognition and Text-to-Speech.

Speech Primer 

ProjectJediButton.gif (3350 bytes)  Interface for the Microsoft Speech API.  
Project JEDI Conversion Library by Alec Bergamini, Alex Hekstra. 

Components for rapidly integrating speech technology and deploying speech-aware applications,

Microsoft's Speech Technology including Speech API SDK

Useful Speech Links 

Telephony ProjectJediButton.gif (3350 bytes)  Telephony API. Used to create Telephony-enabled applications and to create Telephony service providers.  Project JEDI Conversion Library by Marcel van Brakel, Rudolph Velthuis. 
Timer Thread based timer component for driving midi apps
from UseNet Post by Carl Caulkett

Threaded Timer

Video Also see Video for Windows below.

VideoOCX allows easy integration of live video display, capture and saving capabilities into your applications. The control supports most VFW capable video devices like USB cameras or framegrabber AND AVI sequences as image sources. It allows you to save captured video frames in different AVI formats including audio.  Use VideoOCX in most development environments that support ActiveX. Give it a try and download your free evaluation copy today. 

Professional 32bit video capture component 

ProjectJediButton.gif (3350 bytes)  ATI Direct Video Access (DVA) API.  Project JEDI Conversion Library. 

Torry's Video Components 

Die Ansteuerung von Videokarten mit AVI-Capture unter Delphi

Video Capture in Delphi by G. L. Alston.
[This is a Delphi 1 example.  I had to make changes to the code to get it to compile and I never did get it to run, but perhaps I still had some sort of configuration problem.  --efg, 30 Aug 2000] 

TVideo Components 

Component for video capturing, includes a demo program in Delphi 4.

Video, DirectX Non-Delphi:

Download the DirectX 8.0a SDK from  and run the "AmCap" program (which is very similar to the VFW VidCap/VidCap32 programs):   \mssdk\samples\Multimedia\DirectShow\Capture\AMCap

Contact Dave Kazmer,, to find out about his work using EPIX cards with Delphi.
efg's examples below are for the EPIX PIXCI SV4 imaging card using EPIX XCOBJ Software Library.  The PIXCI® SV4 imaging board, for the PCI bus, is designed to take advantage of the power of the host computer.

To create a Delphi interface to the EPIX DLLs, download CtoBAS.EXE from

Run CtoBAS using the EPIX DLLs:
1. ctobas -32 -f xc000w95.dll -predef xcobj.h > xcobj.bas
2. ctobas -32 -f pxxc00w5.dll pxipl.h > pxipl.bas
3. ctobas -32 -f xc000w95.dll pxdipl.h > pxdipl.bas

Conversion of these .BAS files to Delphi is much easier than directly converting the C code.
The two ZIP files below contain a XCOBJ.PAS interface file, which is a conversion of many (not all) of the routines from the C header files.


ScreenDirectXDemo.jpg (42659 bytes)

PIXCI DirectX Video (30 frames/second). Example screen shown above.
Assumes PIXCI card,  XC150W95.DLL and EPIXXC32.VXD are properly configured.

Uses pxd_DirectVideoInit, pxd_DirectVideo and pxd_DirectVideoDone calls from XCOBJ library to display Direct X video in the panel (shown at left).   This panel can be made larger during design mode.  Tested with D4/D5 with S-Video input. Here's a summary of the XCOBJ library calls for this DirectVideo example:

XCOBJ.pxd_xcopen('NTSC/YC', NIL) // S-video
     ORD('v'), // mode
     0,0,0,0, // reserved
     Panel.Handle, // handle
     0,0, // origin
     32767,32767, // width, height
     VideoOverlayColor, // ClrKey1
     VideoOverlayColor); // ClrKey2

The VideoOverlyColor was defined as RGB(0,0,255), i.e., clBlue, in the above pxd_DirectVideo call.  DirectX changed any blue pixel in the screen shot shown above to "live video."   Since a blue ellipse was drawn with a black background, only the blue ellipse shown above will contain the live video.  The timer text, caption text and grid line colors can be changed by clicking on the red square above.  Changing this color to blue will result in video display even through the "blue" grid lines.

The WM_MOVE message simulates a Stop/Start sequence to reposition the DirectX video window (inside the panel).

Source code with example:  EPIXDirectXVideo.ZIP

PIXCI "Live" Video (~7 frames/second)
Brightness and Contrast scrollBars affect image quality in real-time (adapted from EPIX C example).  Flip/Reverse check boxes can be used to change image display using various parameters with pxd_StretchDIBits.  Image sizes of 160-by-120, 320-by-240, 480-by-360, or 600-by-450 can be selected via a radiogroup control.

A 20 ms Timer is used to capture and display images as quickly as possible using pxd_snap.   (Slightly better results -- perhaps a few more frames per second -- can be obtained using a threaded timer.)  This approach allows some user-controlled modification of each frame before it is displayed, but the frame rates are far lower than the pxd_DirectVideo in the example aboe.

Tested with D4/D5 with S-Video input.


Video for Windows (VFW)

J. Hübler's TVideo.  Two components for video capturing using Video for Windows.  
[efg:  TVideo works very well.  Demo1 is somewhat similar to the Microsoft VideoCap C++ program from]

David Taylor's WebCam.  Program to allow Video For Windows device, such as Connectix Color QuickCam, to be used as a Web Camera.

Joe Hecht's UseNet Post about capturing an image from a video source.
How can I capture an image from a video source?   (FAQ 1037D) [by Joe Hecht]

Peter Haas' VFW and a PC camera demo that describes three different ways to get a single frame in a TBitmap.
Extend this example to select a CODEC:

procedure TMainForm.BtnDlgVideoCompressionClick(Sender: TObject);
  if FCapWnd <> 0 then

Peter Haas' UseNet Post about setting the capture frame rate

Toni Martir's notes and complete VFW example (see ShevinE's improvement below).   (Note:  to get Toni's complete example to compile in D3-D5, make sure you can compile with USES OLE2:

Tools | Environment Options | Library | Library Path
D3: C:\Program Files\Borland\Delphi 3\Lib\Delphi2
D4-5: $(DELPHI)\Lib\Delphi2)

Use Lizard.AVI or another AVI file with Toni's example.

ShevinE's improvements to Toni Martir's example (D3-D5 source).   Saves AVI to BMP files as FrameXX.BMP.  Includes VFW.PAS file used in Toni's example.  (Requires USES OLE2 -- see above notes for details.)  [Use Lizard.AVI or another AVI file.]

Delphi import unit for the VFW SDK.  is a older version of a VfW header translation.  Ivo Steinmann has edited this unit. A link to the new version is (direct) or (indirect).

Component allows to capture images and videos from several   sources (videocams, vcr's, webcams). Has been created using the AVICAP32.dll (from the Win32 API).

Information to VFW AVICapture (Microsoft):

Microsoft Video for Windows (VFW) Developer's Kit

VidCap / VidCap32  [Also see DirectX AMCap]

Video for Windows 

See Rob Anderson's AVIBUILD.
Current version does not handle pf24bit BMPs correctly.
Includes vfw.pas (Video for Windows) interface unit for avifil32.dll.

Visual Basic Multimedia Information Microsoft Visual Basic Multimedia Sample Projects:
- Play an AVI File Stored in a Resource DLL File
- Playing a Streaming Audio File
- Play and Display Wave Data
- Detect and Use Multiple Sound Cards
- Read Joystick Inputs
- Play Audio Compact Discs
- Control a MIDI Device 

VB Info:  VideoCapture Help 

Video for Windows Articles

Voice Torry's Voice Components 

WinIVR is a powerful and user-friendly tool capable of designing custom IVR (Interactive Voice Response) applications. An IVR system is a system that allows your PC to answer an inbound call from the telephone line, and subsequently interacts logically and intelligently with the caller. It "listens" by detecting the digits pressed by the caller on his or her touch-tone keypad. 

Volume Control

How to programmatically control the volume slider?  
See Robert Roßmair's TrrMixer and example posted to UseNet

Charles Hacker's UseNet Post with GetWaveVolume/SetWaveVolume routines
Alexey Glotov's UseNet Post


"A Simple Oscilloscope" 

All about Playing sounds

efg's Resource Demo application shows how to use the following file types in resource files:  BMP, ICO, JPG, GIF (requires Anders Melander's TGIFImage), EMF, TXT, AVI, WAV and cursors

Rawplayer is a program which allows you playing wavefiles, even without header, with 44.1kHZ (CD) and make  a list of them   which is understood by Gear 4.0  (CD-Recording software).   Softscrolling and multithreaded.

WaveClip. Unit for copying WAV files to and from the Clipboard

WaveMix.  A translation of WaveMix DLL to Delphi. Allows multiple wave files to be played simultaneously (max of 8). No need for external DLL or INI files.

ProjectJediButton.gif (3350 bytes)  Wave format constants for use with Audio Compression Manager (ACM) translation. File contains sample app using ACM.  Project JEDI Converted Tool by Alan Lloyd. 

Updated 14 Jun 2009
Since 1 Nov 1998