Code for the Streaming and Non-Streaming Device Duet Sample (DUET2) is almost identical to DUET1. The difference is that DUET2 demonstrates how one of the devices in the multimedia device group can be a non-streaming device. The song in DUET2 is divided in two parts, just as the song in DUET1. However, DUET2 plays one part of the song from a CD in a CD-ROM device connected to the system. This difference in hardware is almost totally isolated from the application. There is a difference of approximately 10 lines of code between the Duet sample programs to handle the major difference in hardware configurations.
This major difference in hardware configuration is buffered from DUET2 by the media drivers. The CD Media Driver performs differently from the Waveform Audio Media Driver because it is dealing with a non-streaming device. When the CD media driver receives a media control interface message from the program (such as PLAY or STOP), it must communicate with the CD-ROM device driver through the IOCtl interface. This is the difference between a media driver that controls a streaming device and a media driver that controls a non-streaming device.