{"id":17573726,"url":"https://github.com/zxdong262/audio-analysis-service","last_synced_at":"2025-03-29T15:28:35.763Z","repository":{"id":57186591,"uuid":"155651543","full_name":"zxdong262/audio-analysis-service","owner":"zxdong262","description":"Audio analysis service","archived":false,"fork":false,"pushed_at":"2018-11-02T16:43:39.000Z","size":43,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T10:46:23.511Z","etag":null,"topics":["ai","audio","google-cloud","nlp"],"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/zxdong262.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}},"created_at":"2018-11-01T02:36:31.000Z","updated_at":"2018-11-02T16:43:40.000Z","dependencies_parsed_at":"2022-09-14T16:50:34.667Z","dependency_job_id":null,"html_url":"https://github.com/zxdong262/audio-analysis-service","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/zxdong262%2Faudio-analysis-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxdong262%2Faudio-analysis-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxdong262%2Faudio-analysis-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zxdong262%2Faudio-analysis-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zxdong262","download_url":"https://codeload.github.com/zxdong262/audio-analysis-service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246203189,"owners_count":20740081,"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":["ai","audio","google-cloud","nlp"],"created_at":"2024-10-21T21:04:33.333Z","updated_at":"2025-03-29T15:28:35.737Z","avatar_url":"https://github.com/zxdong262.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# audio-analysis-service\nAudio convert/analysis service.\n\n## Features\n- Read audio stream from url, convert to flac format, transcript to text with google cloud api\n- Analysis text with google cloud NLP api\n\n## Prerequisites\n- nodejs \u003e= 8.10\n- register google cloud account and set payment method, download your credential json.\n\n## dev\n```bash\ngit clone git@github.com:zxdong262/audio-analysis-service.git\n#or git clone https://github.com/zxdong262/audio-analysis-service.git\ncd audio-analysis-service\n\n# install dependencies\nyarn\n\n# create config\ncp .sample.env .env\n# then edit .env, fill your google credential path\n\n## start local server\nyarn dev\n\n```\n## Build and Run in production env\n```bash\n# install pm2 first if you wanna use pm2\nyarn global add pm2\n# or `npm i -g pm2`\n\n# build\nyarn build\n\n# run production server\nyarn prod-server\n\n# or use pm2\npm2 start bin/pm2.yml\n```\n\n## Use as service\n- `/text-analysis?text=text` for text analysis, including **Sentiment**, **Syntax**, **Classification**, **Entity sentiment**.\n- `/audio-url-to-text` transcript audio url to text with google cloud ai.\n- `/audio-url-analysis` for audio url analysis, will transform to flac first, then transcript to text, then use google cloud ai to anlaysis.\n\n\n```js\n\n  it('text-analysis', function(done) {\n    let text = encodeURIComponent('Hi! My name is Joanna. I will read any text you type here')\n    fetch(`${base}/text-analysis?text=${text}`, {\n      headers: {\n        'Content-Type': 'application/json'\n      }\n    })\n      .then(res =\u003e res.json())\n      .then(res =\u003e {\n        expect(!!res.text).equal(true)\n        done()\n      })\n  })\n\n  it('audio-url-analysis', function(done) {\n    fetch(`${base}/audio-url-analysis`, {\n      method: 'post',\n      body: JSON.stringify({\n        url: `${base}/sample.mp3`,\n        //set headers for auth when needed\n        //headers: {}\n      }),\n      headers: {\n        'Content-Type': 'application/json'\n      }\n    })\n      .then(res =\u003e res.json())\n      .then(res =\u003e {\n        console.log(res)\n        expect(!!res.text).equal(true)\n        done()\n      })\n  })\n\n  it('audio-url-to-text', function(done) {\n    fetch(`${base}/audio-url-to-text`, {\n      method: 'post',\n      body: JSON.stringify({\n        url: `${base}/sample.mp3`,\n        //set headers for auth when needed\n        //headers: {AuthCode....}\n      }),\n      headers: {\n        'Content-Type': 'application/json'\n      }\n    })\n      .then(res =\u003e res.text())\n      .then(res =\u003e {\n        expect(res).includes('name is')\n        done()\n      })\n  })\n```\n\n\n## Use as lib\n\n```bash\nnpm i audio-analysis-service\n```\n\n```js\nimport {textAnalysis} from 'audio-analysis-service/dist/text-analysis'\nimport {speech2text} from 'audio-analysis-service/dist/url2text'\nimport {toFlac} from 'audio-analysis-service/dist/voice-to-flac'\nimport urlAnalysis from 'audio-analysis-service/dist/url-analysis'\n```\n\n## Test\n```bash\nyarn test\n```\n\n## License\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzxdong262%2Faudio-analysis-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzxdong262%2Faudio-analysis-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzxdong262%2Faudio-analysis-service/lists"}