control sound volume by code

  • Hi,


    i have no better idea then use a DLL Import. Found in the WWW:

    Code
    1. DllImport("coredll.dll", EntryPoint = "waveOutSetVolume")]
    2. extern static Int32 waveOutSetVolume(IntPtr hwo, uint dwVolume);


    Called with, e.g. (max. for left/right channel):

    Code
    1. waveOutSetVolume(null,0xFFFFFFFF);


    This refers to the master volume. More details about the Audio Driver capacities you will find in "Audio Driver" chapter of the Device Driver document.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Quote

    cannot convert <null> to system.intPtr


    What's about Google;)

    Code
    1. waveOutSetVolume(IntPtr.Zero, XXX);

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

    Edited once, last by fs-support_ZU ().

  • Quote

    can't find any reference to sound in the device driver documentation.
    To what document exactly (url?) are you refering?


    You are right, this chapter is missing in the current imx6 doc. I refered vybrid doc.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.