Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using WaveOutWrite and low level wave stuff

Posted on 1997-02-13
1
Medium Priority
?
603 Views
Last Modified: 2013-12-04
I would like to see some examples using the low
level Wave stuff. Like WaveOutOpen and WaveOutWrite.
I am in the process of programming wave player using
double buffer methods. But how to implement that using
the Multimedia API I don't know.
0
Comment
Question by:kristjg
1 Comment
 
LVL 1

Accepted Solution

by:
xbwen earned 100 total points
ID: 1299070

Hi, I used to write some code for play low lever wave, such as PlayWave:
UINT WINAPI PlayWave(LPHWAVEOUT lphWaveOut, UINT nDeviceID,                           HWND hWnd,
                     LPWAVEFORMAT lpFormat,
                     HPCSTR hpWaveData, DWORD dwWaveDataSize,
                     DWORD dwLoops, BOOL bDispErrMsg)
{
    ...
    ...
    HWAVEOUT hWaveOut = NULL;
    LPWAVEHDR lpWaveOutHdr = NULL;
    UINT nStatus;
   
    nStatus = ::waveOutOpen(&hWaveOut, nDeviceID, lpFormat,
                            (DWORD)(WORD)hWnd, NULL,
                             WAVE_ALLOWSYNC |                                                 CALLBACK_WINDOW);

    if ((lpWaveOutHdr = (LPWAVEHDR)
                         GlobalAllocPtr(GMEM_MOVEABLE |                                   GMEM_SHARE,                                                                                                                      (DWORD)sizeof(WAVEHDR))) != NULL)
    {
       lpWaveOutHdr->lpData = (LPSTR)hpWaveData;
       lpWaveOutHdr->dwBufferLength = dwWaveDataSize;
       lpWaveOutHdr->dwFlags = WHDR_BEGINLOOP | WHDR_ENDLOOP;                        
       lpWaveOutHdr->dwLoops = dwLoops;
           
       ::waveOutPrepareHeader(hWaveOut, lpWaveOutHdr,                                          sizeof(WAVEHDR));
           
        nStatus = ::waveOutWrite(hWaveOut, lpWaveOutHdr,                                          sizeof(WAVEHDR));
    }
    else
      nStatus = MMSYSERR_NOMEM;
   
    if (nStatus != 0)    // error
    {
        ...
    }
   
    if (lphWaveOut != NULL)
        *lphWaveOut = hWaveOut;
   
    return nStatus;
}
  You also can check with microsoft wavemix example in JumpStart
CD-ROM.
  bottom line, what's your platform?

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question