How to play PCM audio using WINDOWSAPI _c language

Source: Internet
Author: User

This paper introduces the method of using WINDOWSAPI to play PCM audio, which is similar to the principle of using WINDOWSAPI to obtain recording audio in the previous article, where the specific function and structure parameters are not detailed, the same parts are omitted, and only the main functional part code is introduced. As shown below:

1. Waveoutgetnumdevs

2. Waveoutgetdevcaps

3. Waveoutopen

callback function:

void CALLBACK Playcallback (hwaveout hwaveout, UINT umsg, DWORD dwinstance, DWORD dwParam1, DWORD dwParam2);

4. Waveoutprepareheader

5. Waveoutwrite: Start playback immediately after execution, the callback function will be invoked when the current buffer playback completes

Here you need to note:

In order to be able to achieve the continuous playback effect, in the 4th part of the need to prepare two or more than two playback data.
Interested friends can compare the previous article by manually debugging the example described in this article.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.