{"id":17242236,"url":"https://github.com/arronhunt/acrcloud-node","last_synced_at":"2025-04-14T03:24:52.351Z","repository":{"id":38859378,"uuid":"71720320","full_name":"arronhunt/acrcloud-node","owner":"arronhunt","description":"📻💡 Recognize audio recordings with node and the acr-cloud recognition API","archived":false,"fork":false,"pushed_at":"2023-01-12T17:11:09.000Z","size":984,"stargazers_count":20,"open_issues_count":6,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-11T08:43:16.664Z","etag":null,"topics":["acrcloud","audio","audio-recognition"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/acrcloud","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/arronhunt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-23T18:09:31.000Z","updated_at":"2025-03-05T18:05:09.000Z","dependencies_parsed_at":"2023-02-09T12:46:15.647Z","dependency_job_id":null,"html_url":"https://github.com/arronhunt/acrcloud-node","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arronhunt%2Facrcloud-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arronhunt%2Facrcloud-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arronhunt%2Facrcloud-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arronhunt%2Facrcloud-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arronhunt","download_url":"https://codeload.github.com/arronhunt/acrcloud-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248814501,"owners_count":21165777,"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":["acrcloud","audio","audio-recognition"],"created_at":"2024-10-15T06:12:40.230Z","updated_at":"2025-04-14T03:24:52.331Z","avatar_url":"https://github.com/arronhunt.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ACRCloud npm module\n\n[![Node version](https://badge.fury.io/js/acrcloud.svg?style=flat)](https://www.npmjs.com/package/acrcloud)\n![Dependencies](https://david-dm.org/arronhunt/acrcloud-node.svg)\n\n## How to use\n\nBefore you can begin identifying audio with ACRCloud's API, you need to sign up for a free trial over at https://www.acrcloud.com and create an Audio \u0026 Video recognition project. This will generate a `host`, `access_key`, and `access_secret` for you to use.\n\n### Set up\n\nTo create a new instance of ACRCloud, all you need to do is install the module and require it in the head of your project.\n\n```js\nconst acrcloud = require(\"acrcloud\");\n\nconst acr = new acrcloud({\n  host: \"us-west-2.api.acrcloud.com\",\n  access_key: \"*****\",\n  access_secret: \"*****\"\n});\n```\n\n### Usage\n\nTo identify an audio file, use the `identify()` function and pass it a file buffer from a local directory.\n\n```js\nconst fs = require(\"fs\");\nconst sample = fs.readFileSync(\"/path-to-file.wav\");\n\nacr.identify(sample).then(metadata =\u003e {\n  console.log(metadata);\n});\n```\n\n### Audio file vs Audio fingerprint\n\nThe ACRCloud API accepts either a raw audio file (WAV, MP3, AIFC, etc), or an audio fingerprint as the POST body. _At the time of writing, this module is only set up to accept a raw audio file._ Finterprints will be included in a future update, or you can modify the script yourself to accept them.\n\n### Optional parameters\n\nBy default, creating a new instance will assume that your audio file has all the necessary headers in order to successfully parse and identify the file. There are additional optional parameters you can use when creating the acr instance.\n\n- `audio_format` The format of your audio data, like \"mp3, wav, ma4, pcm, amr\" etc, If your audio file does not have audio header, this parameter should be included\n- `sample_rate` If your audio file does not have audio header, this parameter should be included\n- `audio_channels` If your audio file does not have audio header, this parameter should be included. Allowed values: 1, 2\n\n```js\nconst acr = new acrcloud({\n  host: \"us-west-2.api.acrcloud.com\",\n  access_key: \"*****\",\n  access_secret: \"*****\",\n  audio_format: \"wav\",\n  sample_rate: 44100,\n  audio_channels: 2\n});\n```\n\n## TODO\n\n- ☐ Accept audio fingerprints in addition to audio files.\n- ☐ Remove fetch dependency and replace with https module.\n- ☐ Write better tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farronhunt%2Facrcloud-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farronhunt%2Facrcloud-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farronhunt%2Facrcloud-node/lists"}