Skip to content

About

Kotlin native silk codec via cinterop

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

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

About

Kotlin native silk codec via cinterop

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages