transform audio file to silk
Project description
Graiax-silkcoder
这,是一个Python的silk转码器
使用方法
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(), '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的音频
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file graiax-silkcoder-0.0.3.tar.gz
.
File metadata
- Download URL: graiax-silkcoder-0.0.3.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.8.7 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d973cafd4a633d38e4e617d09d4db7c9e976fb5970268157f2b110c4c547da9 |
|
MD5 | c970526a51a5f6f0836359397f525f45 |
|
BLAKE2b-256 | d8707e5407319bf263d035adba654ce550710cdb65e2b76a0dedcb34bf091275 |
File details
Details for the file graiax_silkcoder-0.0.3-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: graiax_silkcoder-0.0.3-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 109.4 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.5 CPython/3.8.7 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a866a77aedabbcd58e2de104b45f712fb1a524dbe7d3c4dae63231414001f2ef |
|
MD5 | 0393a73784419c2de3a0390ccfb85016 |
|
BLAKE2b-256 | 91b2be51044bcee48bd11bac198cf4213e89bf266631a834b85d133f9c883436 |