Giter Club home page Giter Club logo

libmpxtn-js's Introduction

libmpxtn.js

pxtoneCollageで作成された音楽ファイル(.ptcop)を ブラウザ上でデコード・再生できるようにしたものです。

特徴

libmpxtnというC言語で書かれたpxtoneCollageのデコーダをWebAssemblyにコンパイルし、 それを利用してWebページ上でデコード・再生を可能にしています。 再生には現状audio-feeder用の Float32Arrayの出力をサポートしています。

デモページ

libmpxtn.js デモページ

TODO: 後日Github Pagesにつくりなおす

サポートするブラウザ

  • WebAssemblyをサポートするブラウザ(ES6 classも使ってます)

  • 参考: Can I Use?

使い方

libmpxtn.min.jslibmpxtn.wasmをサーバに配置して、HTMLに以下を加えます。

<script src="libmpxtn.min.js"></script>

javascriptからlibmpxtnのインスタンスを作り出します。 引数は順に確保するメモリmpxtn_vomit系で使用するバッファサイズwasmのパスです。

let mpxtn = new libmpxtn(33554432, 4096, "libmpxtn.wasm");

あとはwasmをロードすれば各種のメソッドが使えるようになります。

mpxtn.load_wasm().then(results => {
	const total = mpxtn.mpxtn_get_total_samples();
	...
});

ライセンス

  • Javascript
  • MIT

ogg/vorbisのデコードはlibogglibvorbisのソースを利用しています。 また、ogg/vorbisで使用されているmathやsortのCライブラリはmusl libcのソースを利用しています。

  • libmpxtn.wasm
    • libmpxtn - MIT
    • libogg - BSD
    • libvorbis - BSD
    • musl libc - MIT

libmpxtn-js's People

Contributors

stkchp avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.