Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graiax-silkcoder-0.0.3.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

graiax_silkcoder-0.0.3-cp38-cp38-win_amd64.whl (109.4 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page