Help and Support

SAMPLE: Synchronizing Applications with CD Audio

Article ID:103217
Last Review:August 30, 2004
Revision:2.2
This article was previously published under Q103217

SUMMARY

This technical article describes a simple technique that uses the Media Control Interface (MCI) to synchronize events in a Microsoft Windows-based application with audio from a CD. The following topics are covered:

MCI message interface
Audio CD time formats
Owner-draw graphical buttons
Extending the idea to other time sources

MORE INFORMATION

The following file is available for download from the Microsoft Download Center:
Singacd.exe (http://download.microsoft.com/download/platformsdk/sample62/3.1/w31/en-us/singacd.exe)
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 (http://support.microsoft.com/kb/119591/EN-US/) How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

Four pieces of sample code included with this article create four applications: PLAYACD, a simple CD controller; SINGACD, a sing-along application that shows the lyrics to a CD as it plays; TIMEACD, an authoring tool to create the lyric files used by the sing-along application; and SINGAWAV, an application that demonstrates synchronizing to a waveform.

The SINGACD sample application shows how to use the media control interface (MCI) to synchronize an application with CD audio in Microsoft(R) Windows(TM).

SINGACD displays a moving ball above the lyrics of a song. The ball moves in time with the music and (ideally) stays above the current word in the song. Achieving this synchronization involves a two-part process: The first part involves displaying the entire line of text at the right time; the second part involves placing the ball over the correct word in the line.

SINGACD has the following components:
The PLAYACD application is a very simple controller for the MCI CD audio device.
The TIMEACD application is a tool for authoring lyric files.
The SINGAWAV sample is a modified version of SINGACD that opens and plays a specific wave file and lyric file.

APPLIES TO
Microsoft Windows Software Development Kit 3.1

Back to the top

Keywords: 
kb16bitonly kbfile kbmm kbsample KB103217

Article Translations

 

Other Support Options

  • Contact Microsoft
    Phone Numbers, Support Options and Pricing, Online Help, and more.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.