{"id":20778108,"url":"https://github.com/stackgl/gl-audio-analyser","last_synced_at":"2025-04-30T18:41:36.884Z","repository":{"id":66140272,"uuid":"31791947","full_name":"stackgl/gl-audio-analyser","owner":"stackgl","description":"Pull audio waveform/frequency data into WebGL for realtime audio visualisation","archived":false,"fork":false,"pushed_at":"2016-03-28T02:02:28.000Z","size":86,"stargazers_count":57,"open_issues_count":0,"forks_count":6,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-11-02T05:38:36.275Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://stack.gl/gl-audio-analyser","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2015-03-06T22:29:22.000Z","updated_at":"2024-04-23T00:23:33.000Z","dependencies_parsed_at":"2023-02-22T04:45:54.262Z","dependency_job_id":null,"html_url":"https://github.com/stackgl/gl-audio-analyser","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":0.09090909090909094,"last_synced_commit":"712cd6bbaff2e8e008b57e0e6e3d921ca398ce20"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-audio-analyser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-audio-analyser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-audio-analyser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackgl%2Fgl-audio-analyser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackgl","download_url":"https://codeload.github.com/stackgl/gl-audio-analyser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225041031,"owners_count":17411582,"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-11-17T13:19:15.886Z","updated_at":"2024-11-17T13:19:16.424Z","avatar_url":"https://github.com/stackgl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gl-audio-analyser\n\n[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)\n\nPull audio waveform/frequency data into WebGL for realtime audio visualisation!\n\nThis is a wrapper around the more generic/flexible [web-audio-analyser](http://github.com/hughsk/web-audio-analyser) that makes it easier to just drop into a new WebGL project and get up and running quickly.\n\n## Browser Usage\n\n[![NPM](https://nodei.co/npm/gl-audio-analyser.png)](https://nodei.co/npm/gl-audio-analyser/)\n\nYou can pull `gl-audio-analyser` into your project using [browserify](http://browserify.org).\n\nSee [`demo/index.js`](demo/index.js) for a full usage example.\n\n### `analyser = require('gl-audio-analyser')(gl, audio, [ctx])`\n\nCreates a new audio analyser given the following arguments:\n\n* `gl` is the WebGL context you want to use.\n* `audio` is an audio node to analyse, be that an `\u003caudio\u003e` tag,\n  `MediaStream` or `AudioSourceNode`.\n* `ctx` is an (optional) `AudioContext` instance to use.\n  Note however there may only be one instance of this per page,\n  and if not supplied one will be created for you.\n\nOnce created, you should then bind the waveform and/or frequency\ntextures once per frame:\n\n### `analyser.bindWaveform([index])`\n\nUploads the audio's waveform data to a specific texture `index`, which defaults to 0, returning the bound GL texture index.\n\n### `analyser.bindFrequencies([index])`\n\nUploads the audio's frequency data to a specific texture `index`, which defaults to 0, returning the bound GL texture index.\n\n## GLSL Usage\n\nYou can then read the audio data from a texture. For your convenience,\nthis module can also be used with\n[glslify](http://github.com/stackgl/glslify), though the [GLSL module\nsource](index.glsl) is relatively short.\n\nSee [`demo/index.frag`](demo/index.frag) for an example.\n\n### `analyse(sampler2D texture, float audioIndex)`\n\n``` glsl\nuniform sampler2D audioTexture;\n\n#pragma glslify: analyse = require(gl-audio-analyser)\n\nvoid main() {\n  float amplitude = analyse(audioTexture);\n\n  gl_FragColor = vec4(vec3(amplitude), 1.0);\n}\n```\n\n## Contributing\n\nSee [stackgl/contributing](https://github.com/stackgl/contributing) for details.\n\n## License\n\nMIT. See [LICENSE.md](http://github.com/stackgl/gl-audio-analyser/blob/master/LICENSE.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fgl-audio-analyser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackgl%2Fgl-audio-analyser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackgl%2Fgl-audio-analyser/lists"}