{"id":13736556,"url":"https://github.com/jiro4989/wave","last_synced_at":"2025-10-29T23:53:47.261Z","repository":{"id":41885402,"uuid":"235682738","full_name":"jiro4989/wave","owner":"jiro4989","description":"The wave is a tiny WAV sound module","archived":false,"fork":false,"pushed_at":"2023-10-11T10:30:22.000Z","size":644,"stargazers_count":22,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-09T05:46:09.620Z","etag":null,"topics":["lib","media","nim","sound","wave"],"latest_commit_sha":null,"homepage":"https://jiro4989.github.io/wave/wave.html","language":"Nim","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/jiro4989.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2020-01-22T22:45:59.000Z","updated_at":"2024-05-29T18:39:34.000Z","dependencies_parsed_at":"2023-10-11T12:19:28.236Z","dependency_job_id":null,"html_url":"https://github.com/jiro4989/wave","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jiro4989/wave","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fwave","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fwave/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fwave/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fwave/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jiro4989","download_url":"https://codeload.github.com/jiro4989/wave/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jiro4989%2Fwave/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281719940,"owners_count":26549881,"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-29T02:00:06.901Z","response_time":59,"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":["lib","media","nim","sound","wave"],"created_at":"2024-08-03T03:01:23.969Z","updated_at":"2025-10-29T23:53:47.216Z","avatar_url":"https://github.com/jiro4989.png","language":"Nim","readme":"====\nwave\n====\n\n|gh-actions|\n\nThe wave is a tiny `WAV \u003chttps://en.wikipedia.org/wiki/WAV\u003e`_ sound module.\nIt does not support compression/decompression, but it does support mono/stereo.\nThe wave is inspired by `Python wave \u003chttps://docs.python.org/3/library/wave.html\u003e`_.\n\n**Note:**\nThe wave is not supported some sub-chunks yet.\nI will support sub-chunks (`fact`, `cue`, `plst`, `list`, `labl`, `note`, `ltxt`, `smpl`, `inst`) in the future.\n\n.. contents:: Table of contents\n   :depth: 3\n\nInstallation\n============\n\n.. code-block:: Bash\n\n   nimble install wave\n\nUsage\n=====\n\nReading example\n---------------\n\n.. code-block:: nim\n\n   import wave\n\n   var wav = openWaveReadFile(\"tests/testdata/sample1.wav\")\n   doAssert wav.riffChunkDescriptorSize == 116\n   doAssert wav.numChannels == numChannelsMono\n   doAssert wav.sampleRate == 8000'u32\n   doAssert wav.byteRate == 8000'u32\n   doAssert wav.blockAlign == 1'u16\n   doAssert wav.bitsPerSample == 8'u16\n   doAssert wav.numFrames == 80\n   doAssert wav.dataSubChunkSize == 80'u16\n   echo wav\n   ## Output:\n   ## (riffChunkDescriptor: (id: \"RIFF\", size: 116, format: \"WAVE\"), formatSubChunk: (id: \"fmt \", size: 16, format: 1, numChannels: 1, sampleRate: 8000, byteRate: 8000, blockAlign: 1, bitsPerSample: 8, extendedSize: 0, extended: @[]), dataSubChunk: (id: \"data\", size: 80, data: ...), audioStartPos: 44)\n\n   wav.close()\n\nWriting example\n---------------\n\nSquare wave\n^^^^^^^^^^^\n\n.. code-block:: nim\n\n   import wave\n\n   var wav = openWaveWriteFile(\"tests/testdata/example_square.wav\")\n\n   wav.numChannels = numChannelsMono\n   wav.sampleRate = 8000'u16\n\n   wav.writeFrames([0xFF'u8, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00])\n   wav.writeFrames([0xFF'u8, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00])\n   wav.writeFrames([0xFF'u8, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00])\n   wav.writeFrames([0xFF'u8, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00])\n   wav.writeFrames([0xFF'u8, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00])\n   wav.writeFrames([0xFF'u8, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00])\n   wav.writeFrames([0xFF'u8, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00])\n   wav.writeFrames([0xFF'u8, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00])\n   wav.writeFrames([0xFF'u8, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00])\n   wav.writeFrames([0xFF'u8, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00])\n\n   wav.close()\n\nSine wave\n^^^^^^^^^\n\n.. code-block:: nim\n\n   import wave\n   import math\n\n   let\n     width = 127'f\n     sampleRate = 44100'f\n     hz = 440'f\n     seconds = 3\n\n   var wav = openWaveWriteFile(\"tests/testdata/example_sine.wav\")\n\n   wav.numChannels = numChannelsMono\n   wav.sampleRate = sampleRate.uint16\n\n   for _ in 0 ..\u003c seconds:\n     var buf: seq[byte]\n     for i in 0 ..\u003c sampleRate.int:\n       let f = float(i)\n       let b = byte(width * sin(2*PI*hz*f/sampleRate) + width)\n       buf.add(b)\n     wav.writeFrames(buf)\n\n   wav.close()\n\n\nAPI document\n============\n\n* https://jiro4989.github.io/wave/wave.html\n\nPull request\n============\n\nWelcome :heart:\n\nLICENSE\n=======\n\nMIT\n\nSee also\n========\n\nEnglish\n-------\n\n* `WAVE PCM soundfile format \u003chttp://soundfile.sapp.org/doc/WaveFormat/\u003e`_\n* `Wav file format -musicg-api \u003chttps://sites.google.com/site/musicgapi/technical-documents/wav-file-format#fact\u003e`_\n\nJapanese\n--------\n\n* `cpython/Lib/wave.py \u003chttps://github.com/python/cpython/blob/3.8/Lib/wave.py\u003e`_\n* `WAVEファイル読み・書き込み \u003chttps://qiita.com/syuhei1008/items/0dd07489f58158fb4f83\u003e`_\n* `WAV (Waveform Audio File Format) \u003chttps://so-zou.jp/software/tech/file/format/wav/\u003e`_\n* `WAVE(WAV)ファイルフォーマット \u003chttps://uppudding.hatenadiary.org/entry/20071223/1198420222\u003e`_\n* `その103「WAVの構造と現状」 \u003chttps://bb.watch.impress.co.jp/cda/bbword/16386.html\u003e`_\n\n.. |gh-actions| image:: https://github.com/jiro4989/wave/workflows/build/badge.svg\n   :target: https://github.com/jiro4989/wave/actions\n","funding_links":[],"categories":["Multimedia"],"sub_categories":["Audio"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiro4989%2Fwave","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjiro4989%2Fwave","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjiro4989%2Fwave/lists"}