{"id":19301981,"url":"https://github.com/voidashi/wav-compressor-c","last_synced_at":"2026-06-11T01:31:37.464Z","repository":{"id":165390635,"uuid":"538671494","full_name":"voidashi/wav-compressor-c","owner":"voidashi","description":"WAV Audio compressor written in C, using Discrete Fourier transform","archived":false,"fork":false,"pushed_at":"2025-02-13T20:54:02.000Z","size":38,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-15T20:37:58.362Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","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/voidashi.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":"2022-09-19T19:46:18.000Z","updated_at":"2025-10-09T12:25:50.000Z","dependencies_parsed_at":"2025-02-24T01:41:11.208Z","dependency_job_id":"bd14e1d0-0e64-4a66-89a5-cee4c3df05f6","html_url":"https://github.com/voidashi/wav-compressor-c","commit_stats":null,"previous_names":["voidrass/wav-compressor-c","voidashi/wav-compressor-c"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/voidashi/wav-compressor-c","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidashi%2Fwav-compressor-c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidashi%2Fwav-compressor-c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidashi%2Fwav-compressor-c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidashi%2Fwav-compressor-c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voidashi","download_url":"https://codeload.github.com/voidashi/wav-compressor-c/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voidashi%2Fwav-compressor-c/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34178819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"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":[],"created_at":"2024-11-09T23:19:28.899Z","updated_at":"2026-06-11T01:31:37.448Z","avatar_url":"https://github.com/voidashi.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎧 WAV Compressor  \n\n*A DFT-based audio compression tool for WAV files, balancing file size reduction with perceptual quality.*  \n\n[![C](https://img.shields.io/badge/Language-C-informational?style=flat\u0026logo=c\u0026logoColor=white)](https://en.wikipedia.org/wiki/C_(programming_language))  \n[![License](https://img.shields.io/badge/License-MIT-green?style=flat)](LICENSE)  \n\n---\n\n## 📦 Features  \n\n### **Core Functionality**  \n- **WAV File Support**: Read and process standard PCM WAV files (header-aware).  \n- **Frequency Domain Compression**: Leverage Discrete Fourier Transform (DFT) to isolate significant frequencies.  \n- **Threshold-Based Filtering**: Retain only the top `T` coefficients for efficient compression.  \n- **Lossy Reconstruction**: Rebuild audio using Inverse DFT (IDFT) to generate compressed output.  \n\n### **Key Advantages**  \n- **Mathematically Grounded**: DFT/IDFT ensures scientifically sound compression.  \n- **Adjustable Compression**: Customize the trade-off between file size and audio quality via the `T` parameter.  \n- **Lightweight**: No external dependencies beyond standard C libraries.  \n\n---\n\n## 🚀 Getting Started  \n\n### **Clone the Repository**  \n```bash  \ngit clone https://github.com/voidashi/wav-compressor-c.git  \n```  \n\n### **Compile the Code**  \nLink the math library explicitly:  \n```bash  \ngcc main.c compressor.c -o wav_compressor -lm  \n```  \n\n### **Run the Compressor**  \nExecute the binary and follow prompts:  \n```bash  \n./wav_compressor  \n```  \n**Input Example:**  \n```  \naudio.wav   # Input filename  \n500         # Retain top 500 coefficients  \n```  \n**Output:** `audio_comp.wav` (compressed version).  \n\n**Note:** Test with short audio clips first to evaluate quality impact!  \n\n---\n\n## 🧠 Technical Overview  \n\n### **How DFT Compression Works**  \n1. **Time → Frequency Domain**:  \n   DFT converts audio samples into complex frequency coefficients.  \n2. **Coefficient Ranking**:  \n   Sort coefficients by magnitude (most to least significant).  \n3. **Threshold Filtering**:  \n   Discard all but the top `T` coefficients; zero others.  \n4. **Reconstruction**:  \n   Apply IDFT to convert filtered coefficients back to time-domain samples.  \n\n### **Trade-Offs**  \n- **Higher `T`**: Better quality, larger file.  \n- **Lower `T`**: Smaller file, potential artifacts.  \n\n---\n\n## 🛠️ Usage Tips  \n- **Ideal Use Case**: Speech/tonal audio (preserves dominant frequencies well).  \n- **Avoid**: Highly complex audio (orchestral, heavy percussion) unless using high `T`.  \n- **Verify**: Always listen to `audio_comp.wav` to assess perceptual quality.  \n\n---\n\n## 🤝 Contributing  \nFound a bug or improvement?  \n- Open an **Issue** for feature requests or problem reports.  \n- Submit a **Pull Request** for tested, well-commented fixes.  \n\n---\n\n## 📄 License  \nMIT Licensed - See [LICENSE](LICENSE) for details.  \n\n---  \n\n*Compression meets clarity—simplifying audio without losing essence.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoidashi%2Fwav-compressor-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoidashi%2Fwav-compressor-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoidashi%2Fwav-compressor-c/lists"}