Ejemplo n.º 1
0
int Main::run()
{
    audio = new Audio();

    if (!audio->AUDIO_Init())
        return 0;
    
    Uart::getInstance()->puts("Audio Init success\r\n");
    audio->AUDIO_SetLineOutVol(120, 120);
    Uart::getInstance()->puts("Volume set\r\n");

    for (int i = 0; i < 9999; i++)
    {
        for (int j = 0; j < 12; j++)
        {
            AUDIO_DAC_WRITE_L(geluid[j]);
            AUDIO_DAC_WRITE_R(geluid[j]);
            //usleep(2);
        }
        //usleep(200);
    }

    for (int i = 0; i < 9999; i++)
    {
        for (int j = 0; j < 12; j++)
        {
            AUDIO_DAC_WRITE_L(geluid[j]);
            AUDIO_DAC_WRITE_R(geluid[j]);
            usleep(2);
        }
        //usleep(200);
    }

    Uart::getInstance()->puts("Le fin\r\n");
    return 0;
}
Ejemplo n.º 2
0
// call AUDIO_PlayIsReady to make sure the fifo is not full before call this function 
void AUDIO_DacFifoSetData(short ch_left, short ch_right){
    AUDIO_DAC_WRITE_L(ch_left);
    AUDIO_DAC_WRITE_R(ch_right);
}