{"id":28250459,"url":"https://github.com/zackurben/beepbox","last_synced_at":"2025-06-14T01:30:54.162Z","repository":{"id":75304880,"uuid":"151187044","full_name":"zackurben/beepbox","owner":"zackurben","description":"A simple beepbox player!","archived":false,"fork":false,"pushed_at":"2024-08-15T00:49:33.000Z","size":108,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T14:19:55.807Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zackurben.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":"2018-10-02T01:55:00.000Z","updated_at":"2024-08-15T00:49:36.000Z","dependencies_parsed_at":"2023-06-06T02:15:08.691Z","dependency_job_id":null,"html_url":"https://github.com/zackurben/beepbox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zackurben/beepbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackurben%2Fbeepbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackurben%2Fbeepbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackurben%2Fbeepbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackurben%2Fbeepbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zackurben","download_url":"https://codeload.github.com/zackurben/beepbox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zackurben%2Fbeepbox/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259745001,"owners_count":22905027,"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":"2025-05-19T14:18:19.376Z","updated_at":"2025-06-14T01:30:54.157Z","avatar_url":"https://github.com/zackurben.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Beepbox\n\n\u003e Note: This package was originally called `beepbox`, but I've renamed it as `beepbox-lite` to give access to the rightful owner of Beepbox!\n\nA simple library for playing [beepbox](https://www.beepbox.co/) songs. This library is a more polished version of what I made for my [2018 JS13kGames entry](https://github.com/zackurben/js13k-2018)!\n\nThis is an open source project under the MIT license, see [LICENSE.md](LICENSE.md) for additional information.\n\n# Usage\n\n### Create an audio context and load a song\n```js\nimport Audio from 'beepbox';\nimport song from './song.json';\nconst player = new Audio(song);\n```\n\n### Play a beepbox song (once)\n```js\n/**\n * Play the loaded clip once.\n *\n * @returns {Object}\n *   The generic node from Audio.generateNode() for this sequence.\n */\nplayer.play();\n```\n\n### Loop a beepbox song (infinitely)\n```js\n/**\n * Play the loaded clip infinitely.\n *\n * @returns {Object}\n *   The generic node from Audio.generateNode() for this sequence.\n */\nplayer.loop();\n```\n\n### Play a single note\n```js\n/**\n * Play a single note with the given params.\n *\n * @param {Number} freq\n *   The note frequency to play.\n * @param {Number} len\n *   The duration to play the note (seconds).\n * @param {Number} off\n *   The time offset to play the note (seconds).\n * @param {String} type\n *   The OscillatorNode type to use; https://developer.mozilla.org/en-US/docs/Web/API/OscillatorNode/type\n * @param {Number} gain\n *   The gain (volume) to play the note at (0.0 - 1.0).\n *\n * @returns {Object}\n *   The generic node from Audio.generateNode() for this sequence.\n */\nplayer.note(freq, len, off, type, gain);\n```\n\n# Example\n\n```js\n'use strict';\n\nimport Audio from 'beepbox';\nimport song from './song.json';\n\nconst player = new Audio(song);\nplayer.play();\n```\n\n# Contact\n  - Author: Zack Urben\n  - Twitter: https://twitter.com/zackurben (better)\n  - Contact: zackurben@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzackurben%2Fbeepbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzackurben%2Fbeepbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzackurben%2Fbeepbox/lists"}