Skip to content

Commit

Permalink
docs: add silk codec docs
Browse files Browse the repository at this point in the history
  • Loading branch information
RTAkland committed Nov 17, 2024
1 parent e7a0d54 commit a3f8450
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@

# QQBot

[QQBot](qqbot.md)
[QQBot](qqbot.md)

# Silk-Codec

[Silk-Codec](silk.md)
28 changes: 28 additions & 0 deletions docs/silk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Silk Codec

> 简单封装了Silk codec
## 解码

```kotlin
fun main() {
val inputStream: InputStream = ...
val inputStreamSilkBytes: ByteArray = inputStream.decodeToSilk()

val file: File = File("path/to/silk")
val fileSilkBytes: ByteArray = file.decodeToSilk()
}
```

## 编码

```kotlin
fun main() {
val sampleRate = 8000 // 采样率
val inputStream: InputStream = ...
val inputStreamSilkBytes: ByteArray = inputStream.encodeToSilk(sampleRate)

val file: File = File("path/to/silk")
val fileSilkBytes: ByteArray = file.encodeToSilk(sampleRate)
}
```

0 comments on commit a3f8450

Please sign in to comment.