简体   繁体   English

我可以在ALSA中设置时间戳吗?

[英]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. 为此,我需要告诉alsa驱动程序我的音频数据包应在什么时间戳播放。 For this i need to set the timestamp of ALSA. 为此,我需要设置ALSA的时间戳。

I could find the alsa api to get the timestamp (snd_pcm_status_get_tstamp()) at which the audio packet are getting played. 我可以找到alsa api来获取播放音频数据包的时间戳(snd_pcm_status_get_tstamp())。

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. 我找不到用于设置时间戳的任何api。

Please help!! 请帮忙!!

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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