{"id":18651419,"url":"https://github.com/yydounai1234/yami","last_synced_at":"2025-07-30T16:33:13.712Z","repository":{"id":64211058,"uuid":"563212870","full_name":"yydounai1234/Yami","owner":"yydounai1234","description":"变声工具，支持音频链接，本地音频，麦克风音频轨的声音处理","archived":false,"fork":false,"pushed_at":"2022-12-30T08:10:03.000Z","size":12175,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T07:04:41.845Z","etag":null,"topics":["audiocontext","sound-effects","typescript"],"latest_commit_sha":null,"homepage":"https://yydounai1234.github.io/Yami/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yydounai1234.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-11-08T06:17:11.000Z","updated_at":"2024-08-19T16:56:40.000Z","dependencies_parsed_at":"2023-01-15T04:45:54.388Z","dependency_job_id":null,"html_url":"https://github.com/yydounai1234/Yami","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yydounai1234%2FYami","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yydounai1234%2FYami/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yydounai1234%2FYami/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yydounai1234%2FYami/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yydounai1234","download_url":"https://codeload.github.com/yydounai1234/Yami/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248431391,"owners_count":21102194,"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":["audiocontext","sound-effects","typescript"],"created_at":"2024-11-07T06:49:47.731Z","updated_at":"2025-04-11T15:31:10.933Z","avatar_url":"https://github.com/yydounai1234.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yami\n\n使用 **SoundTouch** 提供的变声核心逻辑，通过 **audioContenxt** 将音频资源、音频文件或音频流进行实时变声处理。\n\n本库 wsola 算法以及插值算法借鉴了 [SoundTouchJS](https://github.com/cutterbl/SoundTouchJS) 中的实现，与 [SoundTouchJS](https://github.com/cutterbl/SoundTouchJS) 相比本库的优点在于：\n\n- 1.支持 Typescript\n- 2.支持原生 ESM\n- 3.支持麦克风设备实时变声\n- 4.接口更简洁\n\n缺点在于：\n\n- 1.不支持变速\n\n\u003e 由于使用 **ScriptProcessorNode** 的音频数据输入进行实时变声处理，所以不支持变速功能，如果需要使用到变速功能并且不使用音频流，可以使用 [SoundTouchJS](https://github.com/cutterbl/SoundTouchJS)。\n\n## DEMO\n\n- [在线 DEMO](https://yydounai1234.github.io/Yami/)\n- 下载源码\n\n```text\ngit clone git@github.com:yydounai1234/Yami.git\nyarn install\nyarn dev\n```\n\n## 安装\n\n### NPM\n\n```text\nyarn add yami-voice\n```\n\n### CDN\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/yydounai1234/Yami/dist/Yami.umd.cjs\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n    // ...\n\u003c/script\u003e \n```\n\n### ESM\n\n```html\n\u003cscript type=\"importmap\"\u003e\n  {\n    \"imports\": {\n      \"Yami\": \"https://cdn.jsdelivr.net/gh/yydounai1234/Yami/dist/Yami.cjs\"\n    }\n  }\n\u003c/script\u003e\n\u003cscript type=\"module\"\u003e\n    // ...\n\u003c/script\u003e \n```\n\n## 使用方法\n\n- 初始化类库\n\n```javascript\nconst yami = new Yami()\n```\n\n- 创建音频轨\n\n```javascript\n// 根据 url 地址创建音频轨\nconst urlTrack = await yami.createURLTrack('/test.mp3')\n\n// 根据 buffer 创建音频轨\nconst fileBuffer = new ArrayBuffer()\nconst bufferTrack = await yami.createBufferTrack(fileBuffer)\n\n// 创建设备麦克风输入的音频轨\nconst microphoneTrack = await yami.createMicrophoneTrack()\n```\n\n- 设置变调参数\n\n```javascript\ntrack.pitch = 0.7\n```\n\n- 开始播放\n\nurl / buffer 播放：\n\n```javascript\ntrack.play()\n```\n\n麦克风播放：\n\n```javascript\ntrack.play()\ndocument.getElementByID(\"audio\").srcObject = micoPhoneTrack.stream\n```\n\n## 使用文档\n\n具体的使用文档指南可以查看 [Yami](https://github.com/yydounai1234/Yami/tree/master/wiki/modules.md)。\n\n## LICENSE\n\n由于部分代码借鉴了 [SoundTouchJS](https://github.com/cutterbl/SoundTouchJS)，其采用了 LGPL，故本库也采用 LGPL 协议。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyydounai1234%2Fyami","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyydounai1234%2Fyami","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyydounai1234%2Fyami/lists"}