Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 1.09 KB

README.md

File metadata and controls

53 lines (37 loc) · 1.09 KB

silk-codec

Simple Skype-silk codec kotlin native wrapper. No dependencies needed.

Supports: linuxX64, linuxArm64, mingwX64.

JVM & macOS is not supported yet.

Usage

repositories {
    maven("https://repo.rtast.cn/packages/")
}

sourceSets {
    commonMain.dependencies {
        implementation("cn.rtast.silk-codec:silk-codec:0.0.1")
    }
}

https://repo.rtast.cn/packages/-/cn.rtast.silk-codec:silk-codec

API

fun main() {
    val samplePCM = SystemFileSystem.source(Path("src/commonTest/resources/sample.pcm")).buffered()
        .use { it.readByteArray() }

    val encoded: ByteArray = encodeToSilk(samplePCM)
    val decodeBack: ByteArray = decodeFromSilk(encoded)
    println(encoded.toHexString())
    println(decodeBack.toHexString())
}

Only supports input/output PCM format, also compat Tencent QQ/WeChat format

fun main() {
    val encoded: ByteArray = encodeToSilk(samplePCM, flag = SilkFlag.Tencent)
}

Open source

Skype LICENSE -> LICENSE

NOTICE -> NOTICE

silk-codec open source under Apache-2.0