Audio Media Driver Clipboard Commands

The data that the buffer or clipboard contains will be defined differently for each media driver.

The following formula is necessary to allocate memory for digital audio clipboard operations:
(BitsPerSample/8) x (SamplesPerSecond) x (Channels) x (Seconds)

Therefore, if an application is to copy 20 seconds of a 16-bit, 44 kHz, mono file into the clipboard using the caller's buffer; 1,764,000 bytes ((16/8) x (44100) x (1) x (20)) must be allocated and placed in the pBuff field of the MCI_EDIT_PARMS structure. For MCI_CUT, MCI_COPY, and MCI_PASTE, if MCI_TO_BUFFER or MCI_FROM_BUFFER is passed in, then the pBuff field should contain a valid pointer.

MCI_STATUS_CLIPBOARD returns MCI_TRUE if digital audio is in the clipboard; otherwise it returns MCI_FALSE. MCI_CUT removes the specified range and places the data in the buffer or clipboard. The position of the media will either be the from position if MCI_FROM is specified or the previous position if MCI_FROM is not specified. If the buffer is not large enough for the data an MCIERR_INVALID_BUFFER is returned. The units of MCI_FROM and MCI_TO must be supplied in the currently selected time format. If neither MCI_FROM or MCI_TO are specified, the operation will start from the current file position and continue to the end of the file. If audio data is already in the clipboard, it will be overwritten.

Note: The clipboard contents are emptied before the cut occurs.