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

🎵 WAV player in Go WASM 🎵

License

NotificationsYou must be signed in to change notification settings

braheezy/wavvy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A toy WAV audio player,WASM-style for the browser. You can play a WAV file. You might even be able to play a second one!

I wrote this to learn WASM with Go and specifically audio playback withoto because I wanted to get ready for porting mygoqoa project to WASM.

What's going on

The Go code shown on the site is compiled to a WASM binary and delivered to the browser when you visit. It contains all the logic to read, decode, and perform audio playback of a WAV file. All right in the browser, no weirdo server to talk to. I think this means as long as the file stays cached in the browser, the website will continue to work even if your device is offline.

The HTML frontend provides basic controls to select a WAV file and give it to the WASM executable via explicitly exposed functions. For funs, it also reads the local Go code frommain.go and useshighlight.js to give it some life.

Other than a few more CDN pulls for fonts, this single-page application is comprised of a singleindex.html file along with the requisitewasm_exec.js file that provides the Go glue. And of course, the compiledmain.wasm.

Development

To work with this project locally, you need Go and a way to run a web server. Here's the commands I ran:

# Build itGOOS=js GOARCH=wasm go build -o main.wasm main.go# Serve itpython -m http.server

[8]ページ先頭

©2009-2025 Movatter.jp