{"id":18250586,"url":"https://github.com/asivery/himd-js","last_synced_at":"2026-03-01T16:02:21.930Z","repository":{"id":173129465,"uuid":"624191582","full_name":"asivery/himd-js","owner":"asivery","description":"A typescript library which communicates with Sony HiMD devices. The first HiMD library which implements the DRM required to transfer audio in ATRAC3+ / ATRAC3 / PCM","archived":false,"fork":false,"pushed_at":"2026-01-18T11:56:57.000Z","size":127,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-18T18:41:36.512Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asivery.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-06T00:04:29.000Z","updated_at":"2026-01-18T11:56:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"92253236-8c73-4983-8795-c3be3c7a2f2b","html_url":"https://github.com/asivery/himd-js","commit_stats":null,"previous_names":["asivery/himd-js"],"tags_count":26,"template":false,"template_full_name":null,"purl":"pkg:github/asivery/himd-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fhimd-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fhimd-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fhimd-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fhimd-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asivery","download_url":"https://codeload.github.com/asivery/himd-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fhimd-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29974321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T15:41:30.362Z","status":"ssl_error","status_checked_at":"2026-03-01T15:37:07.343Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-05T09:45:15.978Z","updated_at":"2026-03-01T16:02:21.915Z","avatar_url":"https://github.com/asivery.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## JS library for accessing HiMD Minidisc devices\n\nThis is a brand new library for reading and writing HiMD media.\nUnlike [linux-minidisc](https://github.com/linux-minidisc/linux-minidisc), himd-js supports writing ATRAC3, ATRAC3+ and PCM audio as well as MP3.\n\nFor now, it is impossible to use this library as a standalone application - there's no CLI available.\n\n## How to incorporate it into your project?\n\nThe library has two modes of operation:\n\n### 1 - FileSystem access only\n\nIn this mode, it's only possible to read and write tracks' metadata (titles, track play order, etc.), upload MP3s and download the audio.\n\n**It is not possible to upload ATRAC3/3+/PCM with this mode.**\n\nExample:\n```ts\nasync function example(){\n    // When using Node.JS:\n    const fs = new NativeHiMDFilesystem(\"/path/to/HiMD/root\");\n    // When using Chrome (FileSystemAccess API):\n    const fs = await FSAHiMDFilesystem.init();\n\n    const himd = await HiMD.init(fs);\n\n    // Use the HiMD handle\n    renameDisc(himd, \"Example disc!\");\n\n    // Upload an MP3 file\n    const stream = await himd.openWriteStream();\n    const title = {\n        title: \"Example\",\n        album: \"Test\",\n        artist: \"Foobar\",\n    };\n    await uploadMP3Track(himd, stream, mp3DataArrayBuffer, title, console.log);\n    \n    // Do not forget to flush the changes!\n    await himd.flush();\n}\n```\n\n### 2 - Direct mode (USB Mass Storage Controller mode)\n\nBecause this mode takes full control over the HiMD device, and can issue SCSI commands directly to it, it's possible to upload ATRAC3/3+/PCM audio\n\nAll the examples from mode 1 which utilize the `HiMD` object still work.\n\nExample:\n```ts\nasync function example(){\n    // There are two ways to get the WebUSB handle for a HiMD device\n    // 1. Under Chrome - use the `netmd-exploits` library with the 'HiMDUSBClassOverride' exploit\n    // 2. Under Node.JS - use the legacy API of the `usb` library, then invoke `.detachKernelDriver()` on the interface object\n    const fs = new UMSCHiMDFilesystem(webusbHiMDSCSIHandle);\n    await fs.init();\n    const driver = fs.driver;\n\n    const himd = await HiMD.init(fs);\n\n    // Upload a MAC-protected audio track (AT3/3+/PCM)\n    const title = {\n        title: \"Example\",\n        album: \"Test\",\n        artist: \"Foobar\",\n    };\n\n    // Create a WriteStream\n    const stream = await himd.openWriteStream();\n\n    // Create a new session\n    const session = new UMSCHiMDSession(driver, himd);\n    await session.performAuthentication();\n\n    // Example for ATRAC3 at 66kbps (LP4 on normal Minidisc)\n    const codecInfo = generateCodecInfo(\"AT3\", HiMDKBPSToFrameSize.atrac3[66]);\n    await uploadMacDependent(himd, session, stream, atrac3RawArrayBuffer, codecInfo, title, console.log);\n    \n    // Finalize the session\n    await session.finalizeSession();\n}\n```\n\n### Credits\n- Thank you to M Karcher over at the MiniDisc.wiki Discord server for explaining how the DRM implemented by HiMD devices works. This wouldn't be possible without his incredible help.\n- The linux-minidisc documentation on HiMD SCSI commands and file formats ([1](https://wiki.physik.fu-berlin.de/linux-minidisc/himddownload), [2](https://wiki.physik.fu-berlin.de/linux-minidisc/doku.php?id=himddiskformat), [3](https://wiki.physik.fu-berlin.de/linux-minidisc/himdscsi), [4](https://wiki.physik.fu-berlin.de/linux-minidisc/himddownload-keystuff))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasivery%2Fhimd-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasivery%2Fhimd-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasivery%2Fhimd-js/lists"}