-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,8 @@ | |
|
||
# QQBot | ||
|
||
[QQBot](qqbot.md) | ||
[QQBot](qqbot.md) | ||
|
||
# Silk-Codec | ||
|
||
[Silk-Codec](silk.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
``` |