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的音频

#至于silk解码,除了无法剪辑音频外,剩下的方法与encode基本一致

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.5.tar.gz (249.4 kB view details)

Uploaded Source

File details

Details for the file graiax-silkcoder-0.0.5.tar.gz.

File metadata

  • Download URL: graiax-silkcoder-0.0.5.tar.gz
  • Upload date:
  • Size: 249.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.8.7 Windows/10

File hashes

Hashes for graiax-silkcoder-0.0.5.tar.gz
Algorithm Hash digest
SHA256 a196a4c99b44459da551222d45be869ee15a787de836a12780405523b9f5bef6
MD5 4727058d85994ea8345e83bfd6b82b09
BLAKE2b-256 4e584c3dfe2eeacdead24b0a0356cee9b2c2f0442fcb0d7f3075a17c35943e0d

See more details on using hashes here.

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