{"id":14037300,"url":"https://github.com/komanaki/syllabesjs","last_synced_at":"2025-07-27T05:31:21.187Z","repository":{"id":65511419,"uuid":"68619838","full_name":"komanaki/syllabesjs","owner":"komanaki","description":"A JavaScript parser of multiple subtitles or lyrics file formats.","archived":false,"fork":false,"pushed_at":"2016-09-19T15:59:29.000Z","size":47,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-14T11:08:55.659Z","etag":null,"topics":["lyrics","ssa","subrip-text","substation-alpha","subtitle","webvtt"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/komanaki.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":"2016-09-19T15:37:08.000Z","updated_at":"2022-09-11T23:26:22.000Z","dependencies_parsed_at":"2023-01-26T18:45:17.562Z","dependency_job_id":null,"html_url":"https://github.com/komanaki/syllabesjs","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/komanaki%2Fsyllabesjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komanaki%2Fsyllabesjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komanaki%2Fsyllabesjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komanaki%2Fsyllabesjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/komanaki","download_url":"https://codeload.github.com/komanaki/syllabesjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227762664,"owners_count":17816060,"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":["lyrics","ssa","subrip-text","substation-alpha","subtitle","webvtt"],"created_at":"2024-08-12T03:02:40.997Z","updated_at":"2024-12-02T16:32:43.959Z","avatar_url":"https://github.com/komanaki.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"![syllabes.js](logo.png)\n========================\n\nsyllabes.js is a JavaScript library that can parse multiple types of subtitles or lyrics, so you can use them in your application the same way no matter their file format.\n\n**Here's how you could use it :**\n\n- Display subtitles on a video with a custom style\n- Act as a polyfill for browser that doesn't understand WebVTT\n- Scroll the lyrics of a song like a karaoke\n\n**Useful links :**\n\n- [How to contribute](https://github.com/Komanaki/syllabesjs/blob/master/CONTRIBUTE.md)\n- [NPM homepage](https://www.npmjs.com/package/syllabesjs)\n\nsyllabes.js is proudly written in [TypeScript](http://www.typescriptlang.org/), and is available under the [MIT license](https://www.tldrlegal.com/l/mit).\n\nInstallation\n------------\n\nDownload the library using one of these ways :\n\n- Clone this git repository\n- `npm install syllabesjs`\n- Download the [development version](https://raw.githubusercontent.com/Komanaki/syllabesjs/master/dist/syllabes.js) or the production-ready [minifed file](https://raw.githubusercontent.com/Komanaki/syllabesjs/master/dist/syllabes.min.js).\n\nSupported file formats\n----------------------\n\n- **Ultrastar** (.txt) : Used by a PC karaoke game. Contains song metadata and lyrics for one or two people, with syllable precision.\n- **SubRip** (.srt) : Simple subtitles format for videos. Contains sentences with optional formatting and on-screen positioning.\n- **Sub Station Alpha, Advanced SSA** (.ssa, .ass) : Powerful subtitles format for videos. Contains sentences with optional metadata, formatting, styling and on-screen positioning.\n- **WebVTT** (.vtt) : W3C standard to display subtitles on HTML5 videos. Contains sentences with optional formating, on-screen positioning, multiple voices and syllable precision.\n\nFeature               | Ultrastar | SubRip | SSA / ASS | WebVTT\n--------------------- | :-------: | :----: | :-------: | :----:\nSentences             | ✔ | ✔ | ✘ | ✔\nSyllables             | ✔ | - | - | ✘\nMetadata              | ✔ | - | ✘ | ✘\nMultiple tracks       | ✔ | - | - | -\nOn-screen positioning | - | ✔ | ✘ | ✘\nVoice indicators      | - | - | - | ✘\nText formating        | - | ✔ | ✘ | ✘\nText styling          | - | - | ✘ | ✘\n\n**Legend :**\n\n- ✔ : Supported by the format\n- ✘ : Supported by the format but not implemented yet in syllabes.js\n- \\- : Not supported by the format\n\nUsage\n-----\n\nStart by instanciating the library.\n\n```js\nvar sy = new Syllabes();\n```\n\nThen, call the `parse` method of the library with the file format and its content.\n\n```js\nvar parsed = sy.parse('webvtt', '[... file content here ...]');\n```\n\nIt also accepts an optional options object to influence the parsing.\n\n```js\nvar config = {\n    syllable_precision: false  \n};\nvar parsed = sy.parse('ultrastar', '[... file content here ...]', config);\n```\n\nDon't forget to check the demonstration page in the `demo/` folder.\n\nOutput examples\n---------------\n\nSentence object taken from the output of a parsed Ultrastar file :\n\n```javascript\n{\n    id: 1,\n    syllables: [\n        {\n            start: 15650,\n            end: 15950,\n            duration: 300,\n            pitch: 11,\n            text: \"Rah!\",\n            type: \"freestyle\"\n        },\n        {\n            start: 17350,\n            end: 17750,\n            duration: 400,\n            pitch: 11,\n            text: \" Ah...\",\n            type: \"freestyle\"\n        }\n    ]\n}\n```\n\nSentence object taken from the output of a parsed SubRip file :\n\n```javascript\n{\n    id: 1,\n    start: 15650,\n    end: 17750,\n    duration: 2100,\n    text: \"Rah! Ah...\"\n}\n```\n\nThe output can also include various metadata if the file format permits it.\n\nBuilding\n--------\n\n1. Clone the git repository\n2. While in the project repository, execute `npm install`\n3. Execute `gulp watch` so it compiles the source code as you edit it\n4. Execute `gulp build` to build all the source code\n5. Execute `gulp minify` to make a minifed version of the library\n\nBackground\n----------\n\nAt first, syllabes.js was just a bunch of code written for a school project, where we needed to display a song's lyrics in a karaoke-style (so syllable per syllable).\n\nSeeing that there wasn't viable solutions to parse Ultrastar (an open-source Singstar clone) lyrics files in JavaScript, we decided to make our own parser using the few existing specifications of the format.\n\nSeeing that the code worked quite well, I decided to release it in the wild while making enhancements and other files support easy.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomanaki%2Fsyllabesjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkomanaki%2Fsyllabesjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomanaki%2Fsyllabesjs/lists"}