Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kasukusakura/silk-codec
Silk coder; Encode audio to silk; Decode silk to PCM
https://github.com/kasukusakura/silk-codec
audio cli ffmpeg java media silk silk-codec silk-encode silkv3 silkv3decode
Last synced: 4 months ago
JSON representation
Silk coder; Encode audio to silk; Decode silk to PCM
- Host: GitHub
- URL: https://github.com/kasukusakura/silk-codec
- Owner: KasukuSakura
- License: apache-2.0
- Created: 2021-10-01T15:09:49.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-10T03:18:00.000Z (over 1 year ago)
- Last Synced: 2024-10-13T08:22:53.410Z (4 months ago)
- Topics: audio, cli, ffmpeg, java, media, silk, silk-codec, silk-encode, silkv3, silkv3decode
- Language: C++
- Homepage:
- Size: 462 KB
- Stars: 47
- Watchers: 3
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# silk-codec
A library for convert PCM to tencent silk files.
## Features
- [X] Convert PCM to silk
- [X] Convert audio to silk (FFMPEG required)
- [X] Convert silk to PCM## Platform supported
- Windows x64
- Windows x86
- Linux x64
- Linux arm64
- Android x86
- Android x86_64
- Android arm64
- Mac OS## Usage
### CLI
```shell
ffmpeg -y -i $INPUT -acodec pcm_s16le -f s16le -ac 1 tmp.pcm
silk_codec pts -i tmp.pcm -s $HZ -o out.silk
``````text
ffmpeg version git-2020-08-16-5df9724 Copyright (c) 2000-2020 the FFmpeg developers
Input #0, mp3, from 'Conqueror.mp3':
Stream mapping:
Stream #0:0 -> #0:0 (mp3 (mp3float) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, s16le, to 'pipe:':
Metadata:
Stream #0:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
^~~~~
It is $HZ
```### Java
[![Maven Central](https://img.shields.io/maven-central/v/io.github.kasukusakura/silk-codec.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22io.github.kasukusakura%22%20AND%20a:%22silk-codec%22)
Jar was published as `io.github.kasukusakura:silk-codec`
```java
public class A {
public static void normal() throws Throwable {
// System.load(); // load native if necessary
var simpleRate = 44100;
var pcm = "src.pcm";try (var som = new BufferedOutputStream(new FileOutputStream(
"out.silk"
))) {
SilkCoder.encode(
new BufferedInputStream(new FileInputStream(pcm)),
som,
simpleRate
);
}
}public static void any() throws Throwable {
// System.load(); // load native if necessaryvar threadPool = Executors.newCachedThreadPool();
var stream = new AudioToSilkCoder(threadPool);
try (var fso = new BufferedOutputStream(new FileOutputStream("out.silk"))) {
stream.connect("ffmpeg", "src.mp3", fso);
}
System.out.println("DONE");
threadPool.shutdown();
}
}
```