{"id":24617708,"url":"https://github.com/jacoblincool/svelte-audio","last_synced_at":"2025-10-29T01:34:57.578Z","repository":{"id":231072243,"uuid":"780789616","full_name":"JacobLinCool/svelte-audio","owner":"JacobLinCool","description":"Audio Player Component for Svelte.","archived":false,"fork":false,"pushed_at":"2024-04-04T15:44:23.000Z","size":246,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-22T05:21:00.278Z","etag":null,"topics":["audio-player","svelte"],"latest_commit_sha":null,"homepage":"http://jacoblin.cool/svelte-audio/","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/JacobLinCool.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-02T06:56:42.000Z","updated_at":"2025-06-06T07:51:25.000Z","dependencies_parsed_at":"2025-05-07T05:36:46.180Z","dependency_job_id":null,"html_url":"https://github.com/JacobLinCool/svelte-audio","commit_stats":null,"previous_names":["jacoblincool/svelte-audio"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/JacobLinCool/svelte-audio","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2Fsvelte-audio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2Fsvelte-audio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2Fsvelte-audio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2Fsvelte-audio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JacobLinCool","download_url":"https://codeload.github.com/JacobLinCool/svelte-audio/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobLinCool%2Fsvelte-audio/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281544179,"owners_count":26519552,"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","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["audio-player","svelte"],"created_at":"2025-01-24T23:40:04.621Z","updated_at":"2025-10-29T01:34:57.543Z","avatar_url":"https://github.com/JacobLinCool.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Svelte Audio\n\nAudio Player Component for Svelte.\n\n\u003e It uses [APlayer](https://github.com/DIYgod/APlayer) under the hood!\n\n## Installation\n\n```bash\npnpm i -D svelte-audio\n```\n\n## Usage\n\n```html\n\u003cscript lang=\"ts\"\u003e\n    import { Audio } from \"svelte-audio\";\n    import { playlist } from \"./playlist\";\n\n    let paused = false;\n    let time = 0;\n    let volume = 1;\n    let mini = false;\n\u003c/script\u003e\n\n\u003caudio bind:paused bind:time bind:volume bind:mini {playlist}\u003e\n    \u003c!-- Loading Slot --\u003e\n    \u003cdiv\u003eLoading ...\u003c/div\u003e\n\u003c/audio\u003e\n\nPaused: \u003cinput type=\"checkbox\" bind:checked=\"{paused}\" /\u003e Volume:\n\u003cinput type=\"range\" min=\"0\" max=\"1\" step=\"0.01\" bind:value=\"{volume}\" /\u003e Mini:\n\u003cinput type=\"checkbox\" bind:checked=\"{mini}\" /\u003e Current Time: {time}s\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eplaylist.ts\u003c/summary\u003e\n\n```ts\nimport type { Playlist } from \"svelte-audio\";\n\nexport const playlist: Playlist = [\n    {\n        name: \"ChatGPT Help Me!\",\n        artist: \"Jacob, GPT-4, Suno v3\",\n        cover: \"https://cdn1.suno.ai/image_6aee2edf-ba1e-4394-b75e-7385261c4e07.png\",\n        url: \"https://cdn1.suno.ai/ebb95c9f-ef34-4cd1-b0f1-d8a97666550a.mp3\",\n        lrc: \"https://storage.jacoblin.cool/ChatGPT-Help-Me.lrc\",\n    },\n    {\n        name: \"Flavors of the Night: Taipei\",\n        artist: \"Jacob, GPT-4, Suno v3\",\n        cover: \"https://cdn1.suno.ai/image_3400c31e-d6ec-4101-80b1-1ae11dd3d220.png\",\n        url: \"https://cdn1.suno.ai/3400c31e-d6ec-4101-80b1-1ae11dd3d220.mp3\",\n    },\n];\n```\n\n\u003c/details\u003e\n\n![screenshot](./images/screenshot.png)\n\nTo see the full list of props, check out the [Storybook](https://jacoblincool.github.io/svelte-audio).\n\n### Access to APlayer Instance\n\nYou can access the APlayer instance by using the `.player()` method.\n\n```html\n\u003cscript lang=\"ts\"\u003e\n    import { Audio } from \"svelte-audio\";\n    import { playlist } from \"./playlist\";\n\n    let audio: Audio;\n\n    function remove() {\n        audio.player().list.clear();\n    }\n\u003c/script\u003e\n\n\u003cAudio bind:this={audio} {playlist}\u003e\n    \u003cdiv\u003eLoading ...\u003c/div\u003e\n\u003c/Audio\u003e\n\n\u003cbutton on:click={remove}\u003e Remove Songs \u003c/button\u003e\n```\n\nSee all the API methods in the [APlayer Documentation](https://aplayer.js.org/#/home?id=api).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacoblincool%2Fsvelte-audio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacoblincool%2Fsvelte-audio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacoblincool%2Fsvelte-audio/lists"}