Closed KaratekHD closed 3 years ago
Hello,
I do not quite understand how to send audio. Inside the README this code is given:
// Microphone interface public void write(float[] buffer, int len) { byte[] opusPacket = doOpusEncodingHere(buffer, len); packetQueue.add(opusPacket); } @Override public boolean isReady() { return true; } @Override public CodecType getCodec() { return CodecType.OPUS_MUSIC; } @Override public byte[] provide() { try { if (packetQueue.peek() == null) return new byte[0]; // underflow OpusPacket packet = packetQueue.remove(); if (packet == null) return new byte[0]; // underflow return packet.getBytes(); } catch (NoSuchElementException ex) { return new byte[0]; // signals the decoder on the clients to stop } }
But how would I connect this/use it? I just do not understand how this is supposed to work. Thank you
~Jens
Sending audio is documented in a couple places, see:
https://github.com/Manevolent/ts3j-musicbot or https://github.com/Manevolent/manebot-ts3
For partial and full framework examples
Hello,
I do not quite understand how to send audio. Inside the README this code is given:
But how would I connect this/use it? I just do not understand how this is supposed to work. Thank you
~Jens