Giter VIP home page Giter VIP logo

hcapy's Introduction

hcapy

hca2wav wrapper working on Python3.

概要

@NyagamonさんのHCADecoderをベースにしたhcaデコーダ、hca2wavのPython3ラッパーです。

依存

  • Python3
  • C++11

インストール

pip3 install git+ssh://[email protected]/CrescentApricot/hcapy.git

使い方

import hcapy

d = hcapy.Decoder(961961961961961)  # 鍵指定

d.decode_file("target_file.hca")  # target_file.hcaを指定した鍵でデコード

try:
  with open("target_file.hca", "rb") as f, open("decoded.wav", "wb") as f2:
    f2.write(d.decode(f.read()).read())  # bytesからデコード、io.BytesIOでリターンする
except hcapy.InvalidHCAError:
  print("invalid hca!")

鍵について

上記コードでは 961961961961961 のようなintで指定していますが、"0x36ae63907b9e9"のような形式でも、"36ae63907b9e9"のような形式でも、"3907b9e9", "36ae"のような形式でも指定可能です。

出力ファイルパスについて

decode_file の場合、出力ファイルパスを引数 dest に指定することができますが、指定しないこともできます。指定しない場合、src と同じディレクトリに生成されます。

実装予定

  • bytes からのデコード (無理やり実装済み)
  • コマンドラインツール
  • パッケージ構成の正規化(hcapy.Decoder, hcapy.exceptions.Invalid...)

hcapy's People

Contributors

crescentapricot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

hcapy's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.