Can i set timestamp in ALSA?

删除回忆录丶 提交于 2019-12-11 03:22:16

问题


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!!


回答1:


You could not find any API to set the timestamp because there is none.



来源:https://stackoverflow.com/questions/30861021/can-i-set-timestamp-in-alsa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!