{"id":24468734,"url":"https://github.com/diffusionstudio/vits-web","last_synced_at":"2025-04-05T15:10:10.970Z","repository":{"id":247090178,"uuid":"824653595","full_name":"diffusionstudio/vits-web","owner":"diffusionstudio","description":"Web api for using VITS based models in the browser!","archived":false,"fork":false,"pushed_at":"2024-09-09T08:10:42.000Z","size":9140,"stargazers_count":193,"open_issues_count":12,"forks_count":23,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-28T12:53:43.427Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://huggingface.co/spaces/diffusionstudio/vits-web","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/diffusionstudio.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":"2024-07-05T15:52:37.000Z","updated_at":"2025-03-28T07:32:02.000Z","dependencies_parsed_at":"2024-11-20T00:36:34.968Z","dependency_job_id":null,"html_url":"https://github.com/diffusionstudio/vits-web","commit_stats":null,"previous_names":["diffusion-studio/vits-web","diffusionstudio/vits-web"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diffusionstudio%2Fvits-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diffusionstudio%2Fvits-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diffusionstudio%2Fvits-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diffusionstudio%2Fvits-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diffusionstudio","download_url":"https://codeload.github.com/diffusionstudio/vits-web/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353749,"owners_count":20925329,"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-01-21T07:13:03.317Z","updated_at":"2025-04-05T15:10:10.944Z","avatar_url":"https://github.com/diffusionstudio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/diffusion-studio/ffmpeg-js/graphs/commit-activity)\n[![Website shields.io](https://img.shields.io/website-up-down-green-red/http/shields.io.svg)](https://huggingface.co/spaces/diffusionstudio/vits-web)\n[![Discord](https://badgen.net/badge/icon/discord?icon=discord\u0026label)](https://discord.gg/n3mpzfejAb)\n[![GitHub license](https://badgen.net/github/license/Naereen/Strapdown.js)](https://github.com/diffusion-studio/ffmpeg-js/blob/main/LICENSE)\n[![TypeScript](https://badgen.net/badge/icon/typescript?icon=typescript\u0026label)](https://typescriptlang.org)\n\n# Run VITS based text-to-speech in the browser powered by the [ONNX Runtime](https://onnxruntime.ai/)\n\nA big shout-out goes to [Rhasspy Piper](https://github.com/rhasspy/piper), who open-sourced all the currently available models (MIT License) and to [@jozefchutka](https://github.com/jozefchutka) who came up with the wasm build steps.\n\n## Usage\nFirst of all, you need to install the library:\n```bash\nnpm i @diffusionstudio/vits-web\n```\n\nThen you're able to import the library like this (ES only)\n```typescript\nimport * as tts from '@diffusionstudio/vits-web';\n```\n\nNow you can start synthesizing speech!\n```typescript\nconst wav = await tts.predict({\n  text: \"Text to speech in the browser is amazing!\",\n  voiceId: 'en_US-hfc_female-medium',\n});\n\nconst audio = new Audio();\naudio.src = URL.createObjectURL(wav);\naudio.play();\n\n// as seen in /example with Web Worker\n```\n\nWith the initial run of the predict function you will download the model which will then be stored in your [Origin private file system](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system). You can also do this manually in advance *(recommended)*, as follows:\n```typescript\nawait tts.download('en_US-hfc_female-medium', (progress) =\u003e {\n  console.log(`Downloading ${progress.url} - ${Math.round(progress.loaded * 100 / progress.total)}%`);\n});\n```\n\nThe predict function also accepts a download progress callback as the second argument (`tts.predict(..., console.log)`). \u003cbr\u003e\n\nIf you want to know which models have already been stored, do the following\n```typescript\nconsole.log(await tts.stored());\n\n// will log ['en_US-hfc_female-medium']\n```\n\nYou can remove models from opfs by calling\n```typescript\nawait tts.remove('en_US-hfc_female-medium');\n\n// alternatively delete all\n\nawait tts.flush();\n```\n\nAnd last but not least use this snippet if you would like to retrieve all available voices:\n```typescript\nconsole.log(await tts.voices());\n\n// Hint: the key can be used as voiceId\n```\n\n### **That's it!** Happy coding :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiffusionstudio%2Fvits-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiffusionstudio%2Fvits-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiffusionstudio%2Fvits-web/lists"}