Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Base64 generator for waud.js

License

NotificationsYou must be signed in to change notification settings

waud/waudbase64

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Waud

Base64 generator forwaud.js

Base64 decoding is widely supported across all browsers.

Installation

npm install -g waudbase64

Usage

waudbase64 -i sounds -o sounds.json

Help

waudbase64 --helpinfo: Usage: waudbase64 -i sounds -o sounds.jsoninfo: Options:  --input, -i         input folder (default: ./)                  --output, -o        output JSON file (default: sounds.json)     --noBasePath, --nb  doesn't prepend base path to each asset id  --help, -h          help

Example with waud.js

var base64pack = new WaudBase64Pack("assets/sounds.json", _onLoad);function _onLoad(snds:Map<String, IWaudSound>) {  snds.get("assets/beep.mp3").play();}

Sample

http://waud.github.io/sample/base64.html

More Info

Note that the file size of base64 encoded JSON file will be more than the actual sound file(s).

But if your web server havegzip compression enabled for JSON files then the network transfer size will be smaller than loading individual sound files.

Enablinggzip compression is a standard practice and most likely your web server has it enabled already and to verify that you can open the network tab in chrome developer tools and click on any JSON file that's loaded. If you noticeContent-Encoding:gzip in Response Headers section then it's already enabled.

Some numbers for example:

Size of 6 individual mp3 sound files before base64 encoding:589 KB

Size of base64 encoded JSON with all the 6 sounds:785 KB

Network transfer size withgzip enabled:552 KB

Licensing Information

MIT license

This content is released under theMIT License.

Contributor Code of Conduct

Code of Conduct is adapted fromContributor Covenant, version 1.4

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp