Le réseau pour les développeurs > Forums - Accueil > General Windows Development Issues > DirectSound: how to change the input volume of a microphone? (I'm not far from solution I think)
Poser une questionPoser une question
 

QuestionDirectSound: how to change the input volume of a microphone? (I'm not far from solution I think)

  • mercredi 4 novembre 2009 16:53penpen84 Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     
    Hi,

    I have some questions about Directsound and windows mixers.
    My goal is to enumerate all microphones and be able to change the input volume of each one.
    I think i'm not far from the solution, but I don't find what is wrong in my code.
    Here is what I have done:
    - I enumerate all input devices and get a GUID for each one
    - I use a method found on a topic to get the mixer id corresponding to a directsound guid using this method   (but I'm not sure if it works)
    - Then I get the id corresponding to the control in the mixer
    - Then I can modify the volume

    Here is the code: a vs2008 project

    To test, I have connected two microphones usb + the line-in microphone, and I visually check what sliders are moving. But unfortunately it's not the good one ...
    here is a screenshot of all my mixers opened in windows xp.

    Have you an idea of what I am doing wrong? Is there an easiest solution?

    bonus question: do you know if there is a way to know if a microphone is connected or not in Line-in, using Directsound? Because the Line-in is always detected as connected even if no microphone is connected.
    • DéplacéWesley YaoMSFTvendredi 6 novembre 2009 08:08get better support (From:Visual C++ General)
    •