从麦克风解码音频时如何设置FFmpeg解码帧率?

问题描述

我使用FFmpeg从Windows上的麦克风捕获音频数据。主要代码段为client.on('message',message => { if (message.content.toLowerCase() === prefix + 'color') { var role = message.guild.roles.cache.find(role => role.name === "asd"); role.edit({ color: '#c14a8e' }) message.channel.send("Changed color."); } }); 。该程序将以默认速率获取帧,感觉约为每秒4帧。但是我想将此速率设置为每秒30帧。

我尝试了以下操作:while(av_read_frame()){/*...*/},但是它不起作用。我还使用g_codecCtx->framerate = av_make_q(30,1);g_codecCtx->sample_rate = 16000;来设置采样率和通道,但我不知道它是否真的有意义。

您知道如何更改阅读框的速度吗?非常感谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...