none
How to Specifically Use the Sound Card to play a Sound. RRS feed

  • Question

  • Hello All,

    Our development team is trying to write an application that will play various sound file types (e.g. .WAV files). Our mission is to specifically use the sound card which is installed on a system. We are not to use the built-in windows speaker to play the sound file.

    Our questions are : 

    1. When we use an API like sndPlaySound(), can we direct the sound output to the sound card ?

    2. To specifically use the sound card, is it the common convention to use DirectSound/Media Foundation ?

    Thanks all,
    - Bio.
    Monday, January 18, 2010 6:26 AM

Answers

All replies

  • 1.  Sure, you can use it but if you are playing multiple sounds, the wavOut* functions are preferred:  http://msdn.microsoft.com/en-us/library/aa909803.aspx


    2.  You can use dsound or MF but first: MF is Windows Vista and 7 only, and these two frameworks are more complicated than using the above APIs.


    Please use Vote As Helpful (green up arrow at top-left of posts) and Mark As Answer where appropriate.
    My dshow site is http://tmhare.mvps.org.
    • Marked as answer by Lim Bio Liong Monday, January 18, 2010 7:21 AM
    Monday, January 18, 2010 6:55 AM
    Moderator
  • Hello The March Hare,

    Thankyou  very much for the fast response. One other matter :

    In order to enumerate the various waveform-audio output devices available on a system, we will need to :

    1. Call waveOutGetNumDevs() to get total number of devices.

    2. Iterate the devices via waveOutGetDevCaps().

    Would the above sequence be correct ?

    Thanks,
    Bio.
    Monday, January 18, 2010 7:21 AM
  • Here's a good introduction to using the wave* APIs:




    Please use Vote As Helpful (green up arrow at top-left of posts) and Mark As Answer where appropriate.
    My dshow site is http://tmhare.mvps.org.
    • Marked as answer by Lim Bio Liong Monday, January 18, 2010 7:39 AM
    Monday, January 18, 2010 7:26 AM
    Moderator
  • Hello The March Hare,

    Thankyou very much for the link to the introduction. I will study it.

    Best Regards,
    Bio.
    Monday, January 18, 2010 7:39 AM