amixer 左右通道音量设置

#include <stdio.h>
#include <stdlib.h>


int main(int argc, char **argv)
{
    int iRightVol = 0;
    char ucCmdBuf[128] = {0};
    int iLeftVol  = 0;

    iLeftVol = atoi(argv[1]);
    iRightVol = atoi(argv[2]);

    printf("########## iRightVol is %d , iLeft is %d #########\n", iRightVol, iLeftVol);

    system("i2cset -f -y 1 0x18 0x5d 0x99 b");
    system("i2cset -f -y 1 0x18 0x5b 0x99 b");

    sprintf(ucCmdBuf, "amixer cset numid=2 '%d,%d'", iLeftVol, iRightVol);
    printf("########   %s            #############\n", ucCmdBuf);
    system(ucCmdBuf);

    system("i2cget -f -y 1 0x18 0x5d b");
    system("i2cget -f -y 1 0x18 0x5b b");
    

    return 0;
       
}

你可能感兴趣的:(设置)