{"id":20482103,"url":"https://github.com/uk0/wasm-play-mp3","last_synced_at":"2025-08-28T08:06:34.011Z","repository":{"id":103061010,"uuid":"430538884","full_name":"uk0/wasm-play-mp3","owner":"uk0","description":"自动播放音乐，无需点击。  Automatically play music without clicking.   JavaScript + Html","archived":false,"fork":false,"pushed_at":"2021-11-22T02:54:39.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-25T09:38:40.826Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uk0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-22T02:35:41.000Z","updated_at":"2021-11-22T02:54:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff3ac291-06a8-461c-9a1f-44a3f6e5f582","html_url":"https://github.com/uk0/wasm-play-mp3","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/uk0/wasm-play-mp3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uk0%2Fwasm-play-mp3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uk0%2Fwasm-play-mp3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uk0%2Fwasm-play-mp3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uk0%2Fwasm-play-mp3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uk0","download_url":"https://codeload.github.com/uk0/wasm-play-mp3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uk0%2Fwasm-play-mp3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272466998,"owners_count":24939488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-28T02:00:10.768Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T16:11:29.779Z","updated_at":"2025-08-28T08:06:33.975Z","avatar_url":"https://github.com/uk0.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wasm-play-mp3\n自动播放音乐，无需点击。  Automatically play music without clicking.   JavaScript + Html\n\n\n### wasm 相关代码来自 \n\nhttps://ntzyz.io/post/decode-mpeg-layer-3-using-web-assembly-in-browser\n\n\n### 感谢\n\nhttps://github.com/ntzyz \n\n### build\n\n#### 安装emsdk\n\n```bash\n\n# Get the emsdk repo\ngit clone https://github.com/emscripten-core/emsdk.git\n\n# Enter that directory\ncd emsdk\n# Fetch the latest version of the emsdk (not needed the first time you clone)\ngit pull\n\n# Download and install the latest SDK tools.\n./emsdk install latest\n\n# Make the \"latest\" SDK \"active\" for the current user. (writes .emscripten file)\n./emsdk activate latest\n\n# Activate PATH and other environment variables in the current terminal\nsource ./emsdk_env.sh\n\n# use gcc8 g++8\n\n./emsdk install sdk-upstream-main-64bit\n./emsdk install binaryen-main-64bit\n\n\n\n./emsdk  activate sdk-upstream-main-64bit\n./emsdk  activate binaryen-main-64bit\n\n\n```\n\n\n#### 安装libmad\n\n* 1. 下载 libmad https://sourceforge.net/projects/mad/files/libmad/0.15.1b/libmad-0.15.1b.tar.gz/download\n* 2. source ./emsdk_env.sh\n\n```bash\ncd /path/to/libmad.tar.gz/\ntar xzf libmad*.tar.gz\ncd libmad*\nmkdir ../build\nemconfigure ./configure --prefix=$(pwd)/../build\nemmake make\nemmake make install\n```\n\n\n\n#### build-wasm\n\n\n* 1. wasm 环境 X86_64 切换标识 `#define X86_64` wasm 下记得注释掉\n\n```bash\n# main.c 在这个build 文件夹下\nmkdir server\nemcc -I../build/include -L../build/lib main.c -lmad -s WASM=1 -o server/test.html -s TOTAL_MEMORY=268435456  -s EXPORTED_FUNCTIONS=\"['_main','_malloc', '_decode_mp3_to_pcm']\" -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"ccall\",\"cwrap\",\"writeArrayToMemory\"]' -O3\n\n```\n\n#### 查看文件目录\n\n```bash\nroot@DESKTOP-PFF8EKP:/mnt/f/emsdk/build# tree .\n.\n├── include\n│   └── mad.h\n├── lib\n│   ├── libmad.a\n│   ├── libmad.la\n│   ├── libmad.so -\u003e libmad.so.0.2.1\n│   ├── libmad.so.0 -\u003e libmad.so.0.2.1\n│   └── libmad.so.0.2.1\n├── main.c\n└── server\n    ├── test.html\n    ├── test.js\n    └── test.wasm\n```\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuk0%2Fwasm-play-mp3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuk0%2Fwasm-play-mp3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuk0%2Fwasm-play-mp3/lists"}