zoukankan      html  css  js  c++  java
  • waveOutSetVolume

    MSDN上说:

    MMRESULT waveOutSetVolume(
      HWAVEOUT hwo,  
      DWORD dwVolume 
    );

    Parameters

    hwo

    Handle to an open waveform-audio output device. This parameter can also be a device identifier.

    dwVolume

    New volume setting. The low-order word contains the left-channel volume setting, and the high-order word contains the right-channel setting. A value of 0xFFFF represents full volume, and a value of 0x0000 is silence.

    If a device does not support both left and right volume control, the low-order word of dwVolume specifies the volume level, and the high-order word is ignored.

     

    {
        waveOutSetVolume(hwo, dwVolume);
        waveOutClose(hwo);
        break;
    }

    而VLC里面有这么两句:

    static int VolumeGet( aout_instance_t * p_aout, audio_volume_t * pi_volume )
    {
        DWORD i_waveout_vol;
    
    #ifdef UNDER_CE
        waveOutGetVolume( 0, &i_waveout_vol );
    #else
        waveOutGetVolume( p_aout->output.p_sys->h_waveout, &i_waveout_vol );
    #endif
    
        i_waveout_vol &= 0xFFFF;
        *pi_volume = p_aout->output.i_volume =
            (i_waveout_vol * AOUT_VOLUME_MAX + 0xFFFF /*rounding*/) / 2 / 0xFFFF;
        return 0;
    }
    static int VolumeSet( aout_instance_t * p_aout, audio_volume_t i_volume )
    {
        unsigned long i_waveout_vol = i_volume * 0xFFFF * 2 / AOUT_VOLUME_MAX;
        i_waveout_vol |= (i_waveout_vol << 16);
    
    #ifdef UNDER_CE
        waveOutSetVolume( 0, i_waveout_vol );
    #else
        waveOutSetVolume( p_aout->output.p_sys->h_waveout, i_waveout_vol );
    #endif
    
        p_aout->output.i_volume = i_volume;
        return 0;
    }
  • 相关阅读:
    ubuntu上一些好的操作方式 习惯 文件备份
    ubuntu ufw 防火墙的设置
    ubuntu 的SSH 服务
    对一个数组的处理。
    ubuntu 的 crontab 计划任务
    django1.6 apache 项目部署.
    只此荒废的一个半个月。
    myeclipse python插件安装和环境配置(Windows7下)
    ubunt 12.04 64位 english 服务器版安装
    ubuntu sudo自动切换root 无需输入密码
  • 原文地址:https://www.cnblogs.com/zzugyl/p/2922078.html
Copyright © 2011-2022 走看看