The midiStreamOut function plays or queues a stream (buffer) of MIDI data to a MIDI output device.
MMRESULT midiStreamOut(
HMIDISTRM hMidiStream,
LPMIDIHDR lpMidiHdr,
UINT cbMidiHdr
);
Returns MMSYSERR_NOERROR if successful or an error otherwise. Possible error values include the following:
Value | Description |
---|---|
MMSYSERR_NOMEM | The system is unable to allocate or lock memory. |
MIDIERR_STILLPLAYING | The output buffer pointed to by lpMidiHdr is still playing or is queued from a previous call to midiStreamOut. |
MIDIERR_UNPREPARED | The header pointed to by lpMidiHdr has not been prepared. |
MMSYSERR_INVALHANDLE | The specified device handle is invalid. |
MMSYSERR_INVALPARAM | The pointer specified by lpMidiHdr is invalid. |
Because the midiStreamOpen function opens the output device in paused mode, you must call the midiStreamRestart function before you can use midiStreamOut to start the playback.
For the current implementation of this function, the buffer must be smaller than 64K.
The buffer pointed to by the MIDIHDR structure contains one or more MIDI events, each of which is defined by a MIDIEVENT structure.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in mmsystem.h.
Import Library: Use winmm.lib.
Musical Instrument Digital Interface (MIDI) Overview, MIDI Functions, midiStreamOpen, MIDIHDR, MIDIEVENT