{"id":15939693,"url":"https://github.com/binarykitchen/audio-sample","last_synced_at":"2026-01-04T16:07:14.767Z","repository":{"id":36771321,"uuid":"41078032","full_name":"binarykitchen/audio-sample","owner":"binarykitchen","description":"A wrapper to turn webcam audio samples into buffers.","archived":false,"fork":false,"pushed_at":"2024-09-10T22:58:15.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-31T02:22:49.622Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/binarykitchen.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":"2015-08-20T05:52:37.000Z","updated_at":"2024-09-10T22:58:19.000Z","dependencies_parsed_at":"2024-09-11T02:28:25.978Z","dependency_job_id":"f1f47322-728f-4853-bab0-703e56d45924","html_url":"https://github.com/binarykitchen/audio-sample","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"9a511ad62efac49ec25aa92b6582fa55d0939fde"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binarykitchen%2Faudio-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binarykitchen%2Faudio-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binarykitchen%2Faudio-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binarykitchen%2Faudio-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binarykitchen","download_url":"https://codeload.github.com/binarykitchen/audio-sample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232802582,"owners_count":18578685,"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-07T06:20:46.968Z","updated_at":"2026-01-04T16:07:14.725Z","avatar_url":"https://github.com/binarykitchen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# audio-sample\n\nThat's an audio sample class, accepting a Float32Array in the constructor with one public function. It turns that Float32 into a buffer with the most fastest algorithm.\n\nThis within ~20 code lines only by reusing other useful node modules. It cannot get faster and shorter. If I am wrong, let me know and I'll fix that asap.\n\nThis component is very useful for turning raw WebAudio samples, which are in Float32, into a buffer with 16 bit signed integers while respecting endianness.\n\nFor inspiration refer to:\nhttp://blog.groupbuddies.com/posts/39-tutorial-html-audio-capture-streaming-to-node-js-no-browser-extensions\n\n## Install\n```\nnpm i -S audio-sample\n```\n\n## How to use\n\n```\n// just an example, this array can come from the first audio channel of a webcam (getUserMedia)\nvar arrayOfFloats = e.inputBuffer.getChannelData(0)\n\n// create a single audio sample instance\nvar audioSample = new AudioSample(new Float32Array(arrayOfFloats))\n\n// and now, convert it into a buffer super-fast\nvar buffer = audioSample.toBuffer()\n\n// then you can send this buffer easily over to the server and do some processing there\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinarykitchen%2Faudio-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinarykitchen%2Faudio-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinarykitchen%2Faudio-sample/lists"}