Utilisation du e.getMember() au lieu de ce truc chelou que j'ai fait juste pour ce fichier
Discord record en 48000Hz et pas en 44100Hz
This commit is contained in:
9
.idea/JdrBot.iml
generated
9
.idea/JdrBot.iml
generated
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
8
.idea/modules.xml
generated
8
.idea/modules.xml
generated
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/JdrBot.iml" filepath="$PROJECT_DIR$/.idea/JdrBot.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@@ -24,22 +24,27 @@ public class Record extends Command {
|
||||
@Override
|
||||
public void call(GuildMessageReceivedEvent e)
|
||||
{
|
||||
if(e.getGuild().getMember(e.getAuthor()).hasPermission(Permission.ADMINISTRATOR)) {
|
||||
if(e.getMember().hasPermission(Permission.ADMINISTRATOR)) {
|
||||
RecordState currentRS = getGuildRecordState(e.getGuild());
|
||||
|
||||
if (e.getGuild().getMember(e.getAuthor()).getVoiceState().getChannel() != null && !currentRS.isRecording && !currentRS.isProcessing) {
|
||||
if (currentRS.isProcessing) {
|
||||
Utils.sendMessage(e.getChannel(), MessageType.ERROR, "Un enregistrement est en cours de finalisation");
|
||||
return;
|
||||
}
|
||||
if (currentRS.isRecording) {
|
||||
Utils.sendMessage(e.getChannel(), MessageType.ERROR, "Un enregistrement est déjà en cours");
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.getMember().getVoiceState().getChannel() != null) {
|
||||
Utils.sendMessage(e.getChannel(), MessageType.NORMAL, "Lancement d'un enregistrement par " + e.getAuthor().getAsMention() + "\n`!stoprecord` pour le terminer\n`!crecord` pour annuler");
|
||||
|
||||
System.out.println("[" + new Date() + "] Le serveur ID " + e.getGuild().getId() + "(" + e.getGuild().getName() + ") vient de lancer un enregistrement");
|
||||
|
||||
e.getGuild().getAudioManager().openAudioConnection(e.getGuild().getMember(e.getAuthor()).getVoiceState().getChannel());
|
||||
e.getGuild().getAudioManager().openAudioConnection(e.getMember().getVoiceState().getChannel());
|
||||
|
||||
currentRS.newRecord();
|
||||
currentRS.isRecording = true;
|
||||
} else if (currentRS.isProcessing) {
|
||||
Utils.sendMessage(e.getChannel(), MessageType.ERROR, "Un enregistrement est en cours de finalisation");
|
||||
} else if (currentRS.isRecording) {
|
||||
Utils.sendMessage(e.getChannel(), MessageType.ERROR, "Un enregistrement est déjà en cours");
|
||||
} else {
|
||||
Utils.sendMessage(e.getChannel(), MessageType.ERROR, "Vous n'êtes pas dans un salon vocal");
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ public class RecordState {
|
||||
* Defines a default audio format used to record
|
||||
*/
|
||||
private AudioFormat getAudioFormat() {
|
||||
float sampleRate = 44100;
|
||||
float sampleRate = 48000;
|
||||
int sampleSizeInBits = 16;
|
||||
int channels = 2;
|
||||
boolean signed = true;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: fr.Skydust.JdrBot.JdrBot
|
||||
Main-Class: fr.Skydust.JdrBot.JdrBot;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user