I study C ++ in VS2008. The problem is as follows. To play a wav file, as I understand it, you need to use the PlaySound function. But the sound is played only from the beginning. How else can you play the sound and how can you listen to it from an arbitrary place (for example, from the 5th second)?

    1 answer 1

    Playing wav file from memory .

     MCIDEVICEID mciDeviceID; mciDeviceID = mciOpenParms.wDeviceID; MCI_PLAY_PARMS mciPlayParms; mciPlayParms.dwFrom = 300; mciPlayParms.dwTo = 600; mciError = mciSendCommand(mciDeviceID, MCI_PLAY, MCI_FROM | MCI_TO | MCI_WAIT, (DWORD)(LPMCI_PLAY_PARMS)&mciPlayParms); 
    • Thank! Looks like it’s going to be easy with MCI. - iov_94
    • By the way, thanks to HashCode for inserting sample code) - insolor