静音检测是啥
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了静音检测是啥相关的知识,希望对你有一定的参考价值。
参考技术A VAD静音抑制,又称语音活动侦测。静音抑制的目的是从声音信号流里识别和消除长时间的静音期,以达到在不降低业务质量的情况下节省话路资源的作用,它是IP电话应用的重要组成部分。静音抑制可以节省宝贵的带宽资源,可以有利于减少用户感觉到的端到端的时延。根据上面的定义我们可以理解为,当进行语音通讯时,如果终端开启了静音检测功能,当用户在一段时间内没有讲话时,终端不会向外发送语音包或发送少量的包,节约带宽!
2场景定义
在测试之前我们先定义下测试场景
服务器是公网服务器,IP地址是218.249.39.212,其中终端1007使用的是联通上网卡,15623722867使用的是公司内部WIFI。
终端1007用的语音呼叫终端15623722867之前,我们用tcpcump在服务器端先进行抓包,然后再进行抓包。语音呼叫完毕后,停止抓包,然后从服务器中下载抓取的包,在windows中用wireshark或Hammer工具进行分析。
我们分别用不开启静音检测功能与开启静音检测功能的两个包为例来分析!两个包PTIME都为100,速率为4.75kbit/s,
jingyin_100_4.75.pcap开启了静音检测功能进抓的包;
null_jingyin.pcap没有开启静音检测功能时抓的包;
静音的前缀是啥
【中文标题】静音的前缀是啥【英文标题】:What's the prefix for mute静音的前缀是什么 【发布时间】:2021-01-06 16:20:40 【问题描述】:我的机器人有问题。不能静音工作。帮助?找不到任何前缀,也不知道在哪里添加或如何格式化。我在下面链接了大部分代码。反垃圾邮件和踢/禁止工作。任何帮助的编码新手都会很好。提示如何为所有代码转发设置通用前缀?角色被命名为静音,机器人拥有它需要踢的所有前提
const fs = require('fs');
module.exports = class mute
constructor()
this.name = 'mute',
this.alias = ['tempmute'],
this.usage = 'mute';
run(bot, message, args)
let member = message.mentions.members.first();
var command = args[0];
var mentioned = args[1];
var days = parseInt(args[3]);
var hours = parseInt(args[4]);
var seconds = parseInt(args[5]);
if (message.member.hasPermission('MANAGE_ROLES'))
let muterole = message.guild.roles.find(role => role.name === "Muted");
if (!message.guild)
if (message.guild.id === '505872328538718233')
let memberrole = message.guild.roles.find("name", "Member");
member.removeRole(memberrole);
let usermsg = new Discord.RichEmbed();
usermsg.setTitle('You have been Muted.');
usermsg.setColor('76b3fc');
usermsg.setFooter('Please do not attempt to bypass');
usermsg.addField('Muted by:',
`<@$message.author.id>`);
let mutedmsg = new Discord.RichEmbed();
mutedmsg.setTitle('User has been Muted Successfully');
mutedmsg.setColor('76b3fc');
mutedmsg.setDescription(`User muted: $mentioned\nMuted by: <@$message.author.id>\nReason: $input`);
mutedmsg.setFooter('This mute has been logged.');
if (message.content === `$command`)
return message.channel.send('You did not provide a member to mute.');
if (message.content === `$command $mentioned`)
return message.channel.send('Please input a reason for the mute.');
if (message.guild.roles.find(role => role.name))
message.member.addRole(muterole);
if (message.content.includes (`$daysd`))
message.channel.send(mutedmsg);
setTimeout(() =>
member.removeRole(muterole);
usermsg.addField('Punishment Time:',
`$hours Seconds`);
, `$args[2] * 86400`);
if (message.content.includes (`$hoursh`))
message.channel.send(mutedmsg);
setTimeout(() =>
member.removeRole(muterole);
usermsg.addField('Punishment Time:',
`$hours Seconds`);
, `$args[3] * 3600`);
if (message.content.includes (`$secondss`))
message.channel.send(mutedmsg);
setTimeout(() =>
member.removeRole(muterole);
usermsg.addField('Punishment Time:',
`$seconds Seconds`);
, `$args[4] * 1000`);
if (message.content === `$command $mentioned $input`)
message.member.addRole(muterole);
usermsg.addField('Muted for',
`$input`);
usermsg.addField('Punishment Time:',
'Permenant');
message.channel.send(mutedmsg);
if (message.member.id === `$message.author.id`)
return;
if (message.author.id === `$mentioned`)
return message.member.send(usermsg);
message.channel.send(mutedmsg);
console.log('===========================');
console.log(`Member Muted: $mentioned`);
console.log(`Muted by: $message.author.tag`);
console.log(`Reason: $input`);
console.log('===========================');
else
message.channel.send('You do not have a `Muted` Role, This command won\'t work.');
else
message.reply('You do not have permission to do this.');
let jsonlogs = JSON.parse(fs.writeFileSync("./storages/mutelogs.json"));
if (!jsonlogs[message.guild.id])
jsonlogs[message.guild.id] =
mutedby: `$message.author.tag`,
user: `$mentioned`,
reason: `$input`,
days: `$days`,
hours: `$hours`,
seconds: `$seconds`,
;
;
【问题讨论】:
【参考方案1】:你似乎有很多,我的意思是很多来自 Discord.js v11 的过时方法。
我强烈建议您安装最新版本的 DJS 并阅读可在此处找到的所有 v12 更改: https://github.com/discordjs/discord.js/releases/tag/12.0.0
一些例子:
Discord.RichEmbed()
不再存在 -> 使用 Discord.MessageEmbed()
.addRole()
不再存在 -> 使用 message.member.roles.add()
.removeRole()
不再存在 -> 使用 message.member.roles.remove()
【讨论】:
由于机器人还不到一周,我觉得我有 DJS V12,但代码指南已关闭。 您总能在这里找到您需要的所有信息:discord.js.org/#/docs/main/stable/general/welcome,我还强烈建议您在 YouTube 上观看“WornOffKeys”,他们有很棒的 v12 教程。以上是关于静音检测是啥的主要内容,如果未能解决你的问题,请参考以下文章