简体   繁体   中英

Can i set timestamp in ALSA?

I am developing one application in which i need to play audio packets as per timestamp. For this i need to tell alsa driver at what timestamp my audio packet should get played. For this i need to set the timestamp of ALSA.

I could find the alsa api to get the timestamp (snd_pcm_status_get_tstamp()) at which the audio packet are getting played.

void gettimestamp(snd_pcm_t *handle, snd_timestamp_t *timestamp)
{
    int err;
    snd_pcm_status_t *status;
    snd_pcm_status_alloca(&status);
    if ((err = snd_pcm_status(handle, status)) < 0) {
        printf("Stream status error: %s\n", snd_strerror(err));
        exit(0);
    }
    snd_pcm_status_get_tstamp (status, timestamp);
}

I could not find any api to set the timestamp.

Please help!!

您找不到任何用于设置时间戳的API,因为没有。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM