DSstream: DirectSound WAV Streaming Test

Click to open or copy the files for the DSstream sample.

This sample is a DirectSound streaming test. It illustrates streaming data from a disk WAVE file to a DirectSound secondary buffer for playback.

This sample illustrates how to play a long sound using a streaming DirectSoundBuffer.  Because of this design, it may not work correctly when using very short sounds, such as 1 or 2 seconds long.  Those files are more appropriate for static buffers; see DirectSound Mixing Test (DSshow) for examples of how to code such buffers.

There are buttons to play and stop the WAV file, and a check box to indicate whether the file should be looped or not.  Regardless of the check box setting, the DirectSoundBuffer will be played with looping since a streaming buffer is being used.

There are sliders to control the sound's frequency, pan, and volume settings. In addition, there is a slider indicating the progress through the sound data.

On the Options menu, you can toggle Enumerate Drivers, to show what objects DirectSoundEnumerate will list for you.

Building SDK Samples

This sample uses the following keywords:

_assert; _based; _segname; assert; assertfail; assertmessage; buildtitlebartext; button_getcheck; button_setcheck; checkmenuitem; closehandle; combobox_addstring; combobox_findstring; combobox_getcount; combobox_getcursel; combobox_getitemdata; combobox_setcursel; combobox_setitemdata; commdlgextendederror; createchildren; createevent; createsoundbuffer; createthread; createwindow; dbgenable; dbggetlevel; dbginitialize; dbgsetlevel; dbgvprintf; debugbreak; defwindowproc; destroywindow; dialogbox; dialogboxparam; directsoundcreate; directsoundenumerate; dispatchmessage; dlg_about; dodsoundenumerate; dpf; dpi; dprintf; drawmenubar; dsenumdlgproc; dsenumproc; enablemenuitem; enablewindow; enddialog; errormessagebox; fatalappexit; filldatabuffer; fillmemory; getactivewindow; getclientrect; getcurrentposition; getdc; getdlgitem; getmediastartpath; getmenu; getmessage; getopenfilename; getprofileint; getprofileinta; getsystemmenu; getsystemmetrics; gettextextentpoint32; getwindowsdirectory; globalalloc; globalallocptr; globalfree; globalfreeptr; handlecommdlgerror; handlefreqscroll; handlenotifications; handlepanscroll; handlevolscroll; idirectsoundnotify_queryinterface; initapp; initcommoncontrols; initinstance; listbox_addstring; loadcursor; loadfromcommandline; loadicon; loadstring; localalloc; localfree; lock; lstrcat; lstrcata; lstrcmp; lstrcmpi; lstrcpy; lstrlen; lstrlena; mainwindowproc; makeintresource; makelong; makelparam; makewparam; memcpy; memset; messagebox; messageboxa; mmioadvance; mmioascend; mmioclose; mmiocreatechunk; mmiodescend; mmiofourcc; mmiogetinfo; mmioopen; mmioread; mmioseek; mmiosetinfo; mmiowrite; outputdebugstr; outputdebugstringa; play; postmessage; postquitmessage; regclosekey; registerclass; regopenkeyex; regqueryvalueex; release; releasedc; resetwaveplayer; riffcopychunk; sendmessage; setcooperativelevel; setcurrentposition; setfrequency; setnotificationpositions; setpan; setupnotifications; setvolume; setwindowtext; showwindow; static_settext; stop; streambuffersetup; switch; text; timefunc; translatemessage; unlock; unregisterclass; updatefromcontrols; updateprogressbar; updatewindow; va_end; va_start; waitformultipleobjects; warning; waveclosereadfile; waveclosewritefile; wavecopyuselesschunks; wavecreatefile; waveloadfile; waveopenfile; wavereadfile; wavesavefile; wavestartdataread; wavestartdatawrite; wavewritefile; winmain; writeprofilestring; wsprintf; wsprintfa; wvsprintf; wvsprintfa