WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Sound and Media

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

MIDI and MCI Control

Keywords: MIDI control playing music payback playmedia

How do I start and stop MIDI playback?

The following code shows how to start and stop MIDI Playback. The PlayMidi can start it, but then you will have no control on stopping the playback.

The code below shows how to use the PlayMedia function to start a midi playback and then later stop it.



midiname="c:\windows\media\canyon.mid"
midiname=FileNameShort(midiname)   ; for 32 bit only

PlayMedia("open sequencer!%midiname% alias abc123")

PlayMedia("play abc123") 
Message("midi","playing")

PlayMedia("close abc123")
Message("midi","stopped")


MCI File Playback


MMSYSTEM 263 NOT REGISTERED
THIS IS NOT A REGISTERED MCI DEVICE
If you're getting the error message above, and for more information on MCI device playback, take a look at the Microsoft Technical specifications on their Web site. (You'll have to subscribe now!) Search for MCIWnd Window Class. Or these links might work if you're already registered:

http://premium.microsoft.com/msdn/library/sdkdoc/mciwnd_0xt7.htm  
or

http://premium.microsoft.com/msdn/library/sdkdoc/mciwnd_75wz.htm 

MCIWnd is a window class for controlling multimedia devices. A library of functions, messages, and macros associated with MCIWnd provides a simple method to add multimedia playback or recording capabilities to your applications.

The Media Control Interface (MCI) provides standard commands for playing multimedia devices and recording multimedia resource files. These commands are a generic interface to nearly every kind of multimedia device.


Article ID:   W13216
Filename:   Control and stop playback of MIDI and MCI files.txt
File Created: 2001:01:31:10:41:18
Last Updated: 2001:01:31:10:41:18