{"id":18084755,"url":"https://github.com/coderofsalvation/sunvoxjs","last_synced_at":"2025-04-12T20:10:09.314Z","repository":{"id":57374472,"uuid":"182551752","full_name":"coderofsalvation/sunvoxjs","owner":"coderofsalvation","description":"mirror of Alexander Zolotov's sunvoxjs lib","archived":false,"fork":false,"pushed_at":"2020-05-28T19:26:18.000Z","size":257,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T20:09:54.017Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/coderofsalvation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":"https://gumroad.com/l/hGYGh"}},"created_at":"2019-04-21T15:38:52.000Z","updated_at":"2024-10-24T17:23:49.000Z","dependencies_parsed_at":"2022-08-29T18:32:23.223Z","dependency_job_id":null,"html_url":"https://github.com/coderofsalvation/sunvoxjs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fsunvoxjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fsunvoxjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fsunvoxjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fsunvoxjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderofsalvation","download_url":"https://codeload.github.com/coderofsalvation/sunvoxjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625493,"owners_count":21135513,"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","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-10-31T15:08:05.437Z","updated_at":"2025-04-12T20:10:09.284Z","avatar_url":"https://github.com/coderofsalvation.png","language":"JavaScript","funding_links":["https://gumroad.com/l/hGYGh"],"categories":[],"sub_categories":[],"readme":"# sunvoxjs\n\n\u003cimg src=\"http://www.warmplace.ru/soft/sunvox/disk.png\"/\u003e\n\nThis is a mirror of Alexander Zolotov's sunvoxjs lib, so it can be served over CORS (unpkg.com)\n\n## Usage\n\n    \u003cscript src=\"https://unpkg.com/sunvoxjs/sunvox.js\"/\u003e\n    \u003cscript src=\"https://unpkg.com/sunvoxjs/sunvox_lib_loader.js\"/\u003e\n\n## Demo / Docs\n\n[http://warmplace.ru/soft/sunvox/jsplay/](http://warmplace.ru/soft/sunvox/jsplay/)\n\n## Example\n\n\n    \u003cscript\u003e\n        var sfile = \"https://unpkg.com/sunvoxjs/test.sunvox\"\n\n        function status(l){ console.log(l) }\n\n        function loadFromArrayBuffer( buf )\n        {\n            if( buf ) \n            {\n                var byteArray = new Uint8Array( buf );\n                if( sv_load_from_memory( 0, byteArray ) == 0 )\n                {\n                    console.log( \"song loaded\" )\n                    sv_play_from_beginning( 0 );\n                }\n            }\n            else\n            {\n                console.log( \"song load error\" );\n            }\n            \n        }\n\n        function loadSong(fname){\n            console.log( \"loading: \" + fname );\n            var req = new XMLHttpRequest();\n            req.open( \"GET\", fname, true );\n            req.responseType = \"arraybuffer\";\n            req.onload = function( e ) {\n                if( this.status != 200 ){\n                    console.log( \"file not found\" );\n                    return;\n                }\n                var arrayBuffer = this.response;\n                loadFromArrayBuffer( arrayBuffer );\n            };\n            req.send( null ); \n        }\n\n        svlib.then( function(Module) {\n            //\n            // SunVox Library was successfully loaded.\n            // Here we can perform some initialization:\n            //\n            status( \"SunVoxLib loading is complete\" );\n            var ver = sv_init( 0, 44100, 2, 0 ); //Global sound system init\n            if( ver \u003e= 0 )\n            {\n            //Show information about the library:\n                var major = ( ver \u003e\u003e 16 ) \u0026 255;\n                var minor1 = ( ver \u003e\u003e 8 ) \u0026 255;\n                var minor2 = ( ver ) \u0026 255;\n                console.log( \"SunVox lib version: \" + major + \" \" + minor1 + \" \" + minor2 );\n            console.log( \"init ok\" );\n            }\n            else\n            {\n            console.log( \"init error\" );\n            return;\n            }\n            sv_open_slot( 0 ); //Open sound slot 0 for SunVox; you can use several slots simultaneously (each slot with its own SunVox engine)\n            //\n            // Try to load and play some SunVox file:\n            //\n            loadSong( sfile );\n        });\n    \u003c/script\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderofsalvation%2Fsunvoxjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderofsalvation%2Fsunvoxjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderofsalvation%2Fsunvoxjs/lists"}