import io.github.jaredmdobson.concentus.OpusDecoder import io.github.jaredmdobson.concentus.OpusEncoder import kotlinx.coroutines.* /** * Created by LoliBall on 2024/8/31 5:26. * https://github.com/WhichWho */ fun main() = runBlocking { CoroutineScope(Dispatchers.IO).launch { Server.main(emptyArray()) } delay(1000) Client.main(emptyArray()) } fun OpusEncoder.encode( pcm: ByteArray, opusBuffer: ByteArray = ByteArray(pcm.size) ): DataPack { val bytesEncoded = encode(pcm, 0, PACKET_SAMPLES, opusBuffer, 0, opusBuffer.size) return DataPack(System.currentTimeMillis(), opusBuffer.sliceArray(0..