Yanked
This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.3.6 instead.
Reason given by maintainers: Do not have silkv3-extension in wheel file
Graiax-silkcoder
现在版本:
这,是一个Python的silk转码器
通过将kn007/silk-v3-decoder通过简单的封装制成
安装
# 如果需要转换非wav的音频文件,则需要自行安装ffmpeg
pip install graiax-silkcoder
# 也可以通过下面的方式使用imageio-ffmpeg中的ffmpeg
pip install graiax-silkcoder[ffmpeg]
注: 假设你是Windows用户,安装时出现了error: Microsoft Visual C++ 14.0 is required:
请安装Microsoft C++ Build Tools
自定义ffmpeg_path
可能有一些用户会想要自定义ffmpeg的路径 你可以使用以下方法解决:
from graiax import silkcoder
silkcoder.set_ffmpeg_path("./ffmpeg")
使用方法
# 假设你是以 python -m asyncio 启动的python
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', ensure_ffmpeg=True)
#你也可以设置码率(默认状态下将会将尝试将目标语音大小限制在980kb上下)
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')
#你可以文件→二进制数据
wav: bytes=await silkcoder.decode('a.silk')
#你可以二进制数据→二进制数据(必填audio_format)
mp3: bytes=await silkcoder.decode(Path('a.silk').read_bytes(), audio_format='mp3')
#你可以二进制数据→文件
await silkcoder.decode(Path('a.silk').read_bytes(), 'a.wav')
#你可以指定让ffmpeg解码音频,也可以让程序自己选择
#注:只有当音频是wav且ensure_ffmpeg=None时才会不使用ffmpeg处理
await silkcoder.decode('a.silk', 'a.wav', ensure_ffmpeg=True)
#你也可以直接传入ffmpeg参数来输出
await silkcoder.decode('a.silk', 'a.mp3', ffmpeg_para=['-ab', '320k'])
Metadata
Release files for graiax-silkcoder 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| graiax-silkcoder-0.1.3.tar.gz | 205.7 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| graiax_silkcoder-0.1.3-cp310-cp310-win_amd64.whl | CPython 3.10 | CPython 3.10 | Windows x86-64 | Details |
| graiax_silkcoder-0.1.3-cp310-cp310-win32.whl | CPython 3.10 | CPython 3.10 | Windows x86-32 | Details |
| graiax_silkcoder-0.1.3-cp39-cp39-win_amd64.whl | CPython 3.9 | CPython 3.9 | Windows x86-64 | Details |
| graiax_silkcoder-0.1.3-cp39-cp39-win32.whl | CPython 3.9 | CPython 3.9 | Windows x86-32 | Details |
| graiax_silkcoder-0.1.3-cp38-cp38-win_amd64.whl | CPython 3.8 | CPython 3.8 | Windows x86-64 | Details |
| graiax_silkcoder-0.1.3-cp38-cp38-win32.whl | CPython 3.8 | CPython 3.8 | Windows x86-32 | Details |
Total release size: 248.2 kB
Release files / graiax-silkcoder-0.1.3.tar.gz
| Download URL | graiax-silkcoder-0.1.3.tar.gz |
|---|---|
| Size | 205.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
85f5f0bc76712fd63a8895f3b17bc500772fc18614567e6f1eeb38eeb04aa74b
|
|
BLAKE2b-256 checksum How to use checksums |
8a945c0637c80f456f37ffa22c32be31260403d8bff64609e32997ee3789afa5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
|
Release files / graiax_silkcoder-0.1.3-cp310-cp310-win_amd64.whl
| Download URL | graiax_silkcoder-0.1.3-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 7.1 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8cdcddd96ae610710c36063b98c865e6f243d59dfb9f33593c465c49cd9b25ea
|
|
BLAKE2b-256 checksum How to use checksums |
a6818bae2f7a5e824d61dac0205c7eb982d220fdf4f132406656980f9d51f0ca
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
|
Release files / graiax_silkcoder-0.1.3-cp310-cp310-win32.whl
| Download URL | graiax_silkcoder-0.1.3-cp310-cp310-win32.whl |
|---|---|
| Size | 7.1 kB |
| Tags | CPython 3.10 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
04c5b37be9251ab524891c881f37b1309213db773c97f982b4d82d63a84f0a88
|
|
BLAKE2b-256 checksum How to use checksums |
cd4898456550a40d41ca23de4710e191b5dddf0914319ba2b7946584b5c74ff5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1
|
Release files / graiax_silkcoder-0.1.3-cp39-cp39-win_amd64.whl
| Download URL | graiax_silkcoder-0.1.3-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 7.1 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9433db9c1e40f3c5de79a44c6287caaae692eef3d84897d2cc9931222af935a2
|
|
BLAKE2b-256 checksum How to use checksums |
f69c91471f2be1af298c1cec41807560a77553fbc16b67deef9070f26d975065
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / graiax_silkcoder-0.1.3-cp39-cp39-win32.whl
| Download URL | graiax_silkcoder-0.1.3-cp39-cp39-win32.whl |
|---|---|
| Size | 7.1 kB |
| Tags | CPython 3.9 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
527b90ec5c5a35b8a6cc0b548cd2602d9016cce4353e26ca9635d31940901381
|
|
BLAKE2b-256 checksum How to use checksums |
583315b6e43ff4d3f4f513d256cd8533c500e7f20e63b35854a5aa6eb55b9677
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / graiax_silkcoder-0.1.3-cp38-cp38-win_amd64.whl
| Download URL | graiax_silkcoder-0.1.3-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 7.1 kB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
53a920399c704919e4bf985ce3ce1f435db8df548c97198f2748bc651cb7c179
|
|
BLAKE2b-256 checksum How to use checksums |
f54948045698c778404914c4102e0ba4b8692d24a712db46619f54cd7c23d2cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / graiax_silkcoder-0.1.3-cp38-cp38-win32.whl
| Download URL | graiax_silkcoder-0.1.3-cp38-cp38-win32.whl |
|---|---|
| Size | 7.1 kB |
| Tags | CPython 3.8 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
b5c91935080db65090465459a9d177b055e6bc03b2fa64f16b66be754dd315ed
|
|
BLAKE2b-256 checksum How to use checksums |
f64a8798728f0156d93ad28de09ad7cc4bfc1981aaf5f270e1dcd7e280886166
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|