Graiax-silkcoder
这,是一个Python的silk转码器
安装
pip install graiax-silkcoder
# 如果需要转换非wav的音频文件,则需要ffmpeg/anconv
# 如何安装ffmpeg/anconv请自行百度
使用方法
from pathlib import Path
from graiax import silkcoder
#silk编码
#你可以文件→文件
await silkcoder.encode('a.wav', 'a.silk')
#你可以文件→二进制数据
silk: bytes=await silkcoder.encode('a.wav')
#你可以二进制数据→二进制数据
silk: bytes=await silkcoder.encode(Path('a.wav').read_bytes())
#你可以二进制数据→文件
await silkcoder.encode(Path('a.wav').read_bytes(), audio_format='wav', 'a.silk')
#你可以指定让ffmpeg解码音频,也可以让程序自己选择
#注:只有当音频是wav且ensure_ffmpeg=None时才会不使用ffmpeg处理
await silkcoder.encode('a.wav', 'a.silk')
await silkcoder.encode('a.wav', 'a.silk', ensure_ffmpeg=True)
#你也可以设置码率(默认65000)
await silkcoder.encode('a.wav', 'a.silk', rate=70000)
#你甚至可以剪辑音频
await silkcoder.encode('a.wav', 'a.silk', ss=10, t=5)#从第10s开始剪辑5s的音频
#silk解码
#你可以文件→文件
await silkcoder.decode('a.silk', 'a.wav')
#你可以文件→二进制数据
silk: bytes=await silkcoder.decode('a.silk')
#你可以二进制数据→二进制数据(必填audio_format)
silk: bytes=await silkcoder.decode(Path('a.silk').read_bytes(), audio_format='mp3')
#你可以二进制数据→文件
await silkcoder.encode(Path('a.silk').read_bytes(), 'a.wav')
#你可以指定让ffmpeg解码音频,也可以让程序自己选择
#注:只有当音频是wav且ensure_ffmpeg=None时才会不使用ffmpeg处理
await silkcoder.encode('a.wav', 'a.silk')
await silkcoder.encode('a.wav', 'a.silk', ensure_ffmpeg=True)
#你也可以设置码率(默认65000)
await silkcoder.encode('a.wav', 'a.silk', rate=70000)
#你甚至可以剪辑音频
await silkcoder.encode('a.wav', 'a.silk', ss=10, t=5)#从第10s开始剪辑5s的音频
Metadata
Release files for graiax-silkcoder 0.0.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| graiax-silkcoder-0.0.13.tar.gz | 254.4 kB | Without provenance | Details for graiax-silkcoder-0.0.13.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| graiax_silkcoder-0.0.13-cp38-cp38-win_amd64.whl | CPython 3.8 | CPython 3.8 | Windows x86-64 | Details for graiax_silkcoder-0.0.13-cp38-cp38-win_amd64.whl |
Total release size: 1.3 MB
Release files / graiax-silkcoder-0.0.13.tar.gz
| Download URL | graiax-silkcoder-0.0.13.tar.gz |
|---|---|
| Size | 254.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ef2407b8b0c2eceb2da297747b67a25b9cf479c3189a2a1fecbf06e1ed99557
|
|
BLAKE2b-256 checksum How to use checksums |
09684f0478a7bb4c4f61d2946f21bd82806c9f983e415c878dc348fc19035d6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.7 CPython/3.8.10 Windows/10
|
Release files / graiax_silkcoder-0.0.13-cp38-cp38-win_amd64.whl
| Download URL | graiax_silkcoder-0.0.13-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
c12ffd9be99aff2e11dd9052527d96da6d6f1add5ddd7e74519b9835b6816c06
|
|
BLAKE2b-256 checksum How to use checksums |
fc52e69f2b8c3b4dd6333a89005499f736567b8f3e3400f522d6a1e279339024
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.7 CPython/3.8.10 Windows/10
|
Security for graiax-silkcoder 0.0.13
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.