{"id":13804787,"url":"https://github.com/thecodrr/vave","last_synced_at":"2026-03-05T10:02:36.008Z","repository":{"id":66253898,"uuid":"227318315","full_name":"thecodrr/vave","owner":"thecodrr","description":"🌊 A crazy simple library for reading/writing WAV files in V. Zero dependencies, 100% cross-platform.","archived":false,"fork":false,"pushed_at":"2024-06-15T12:28:27.000Z","size":22,"stargazers_count":40,"open_issues_count":2,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-27T18:18:22.289Z","etag":null,"topics":["audio","deepspeech","sample-rate","v","vave","vlang","wavefile"],"latest_commit_sha":null,"homepage":null,"language":"V","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/thecodrr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"thecodrr","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-12-11T08:50:09.000Z","updated_at":"2025-02-15T08:40:30.000Z","dependencies_parsed_at":"2024-11-11T21:39:48.638Z","dependency_job_id":"b25355d5-af52-4d61-9c4a-f17d7f5b2454","html_url":"https://github.com/thecodrr/vave","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thecodrr/vave","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodrr%2Fvave","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodrr%2Fvave/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodrr%2Fvave/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodrr%2Fvave/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodrr","download_url":"https://codeload.github.com/thecodrr/vave/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodrr%2Fvave/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30118932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T09:35:22.236Z","status":"ssl_error","status_checked_at":"2026-03-05T09:35:20.028Z","response_time":93,"last_error":"SSL_read: 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":["audio","deepspeech","sample-rate","v","vave","vlang","wavefile"],"created_at":"2024-08-04T01:00:53.951Z","updated_at":"2026-03-05T10:02:35.950Z","avatar_url":"https://github.com/thecodrr.png","language":"V","funding_links":["https://ko-fi.com/thecodrr"],"categories":["Libraries"],"sub_categories":["Audio"],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1\u003e🌊 Vave\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\nA crazy simple library for reading/writing WAV files written in V!\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://i.imgur.com/ssfAcm7.png\"/\u003e\n\u003c/p\u003e\n\u003c/div\u003e\n\n## Installation:\n\nInstall using `vpkg`\n\n```bash\nvpkg get https://github.com/thecodrr/vave\n```\n\nInstall using `V`'s builtin `vpm` (you will need to import the module with: `import thecodrr.vave` with this method of installation):\n\n```shell\nv install thecodrr.vave\n```\n\nInstall using `git`:\n\n```bash\ncd path/to/your/project\ngit clone https://github.com/thecodrr/vave\n```\n\nThen in the wherever you want to use it:\n\n```javascript\nimport thecodrr.vave //OR simply vave depending on how you installed\n```\n\nAnd that's it!\n\n## Usage\n\n_This library is in use in the [vspeech](https://github.com/thecodrr/vspeech) (V Bindings for DeepSpeech) utility that uses [Mozilla's DeepSpeech](https://github.com/mozilla/DeepSpeech) for Speech-to-Text. Do check that out as well._\n\n### vave.open(`path`,`mode`)\n\nOpen a new WAV file in the specified mode. All mode supported by `C.fopen` are supported (e.g. `r`, `rb` etc.)\n\n```javascript\nmut wav := vave.open(\"/path/to/vave/file\", \"r\") //open for reading\n```\n\n**NOTES:** The data is read into a `byteptr` and needs to be manually freed each and everytime or it will cause a huge memory leak. This library has been tested with `valgrind` and after freeing there is no other memory leak (if you find any, do report). I haven't implemented writing samples yet due to lack of time but its in my future plans.\n\n### WavFile `struct`\n\n`WavFile` struct is used for reading/writing samples and other metadata. It is returned by `vave.open`.\n\n#### Read:\n\n#### WavFile.read_raw()\n\nRead all the samples from the file in their raw form.\n\n#### WaveFile.read_samples(`count`)\n\nRead a specific amount of samples from the file.\n\n#### WaveFile.read_sample()\n\nRead only one sample from the file.\n\n#### Write:\n\n**TODO**\n\n#### WaveFile.close()\n\nClose the file and free all associated resources.\n\n### Metadata Methods:\n\n#### WaveFile.total_samples()\n\nGet total number of audio samples in the file.\n\n#### WaveFile.duration()\n\nGet total duration of the audio file.\n\n#### WaveFile.data_len()\n\nGet the total length of sample bytes in the file.\n\n#### WaveFile.bytes_per_sample()\n\nGet total bytes per each sample.\n\n#### WaveFile.sample_rate()\n\nGet the sample rate (samples per second).\n\n#### WaveFile.sample_size()\n\nGet the size of one sample()\n\n#### WaveFile.format()\n\nGet the format of the WAV audio. Either `PCM`, `IEEE`, `ALAW`,`MULAW` or `EXTENSIBLE`.\n\n#### WaveFile.num_channels()\n\nGet the total number of channels in the audio stream.\n\n#### WaveFile.valid_bits_per_sample()\n\nGet the bits per each sample.\n\n## Supported Formats:\n\nCurrently only the following formats are supported:\n\n1. PCM\n\n2. IEEE\n\n3. ALAW\n\n4. MULAW\n\n5. EXTENSIBLE\n\n### Find this library useful? :heart:\n\nSupport it by joining **[stargazers](https://github.com/thecodrr/vave/stargazers)** for this repository. :star:or [buy me a cup of coffee](https://ko-fi.com/thecodrr)\nAnd **[follow](https://github.com/thecodrr)** me for my next creations! 🤩\n\n# License\n\n```xml\nMIT License\n\nCopyright (c) 2019 Abdullah Atta\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodrr%2Fvave","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodrr%2Fvave","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodrr%2Fvave/lists"}