{"id":50294826,"url":"https://github.com/chrisrobison/spectrogram","last_synced_at":"2026-05-28T08:04:09.282Z","repository":{"id":289837947,"uuid":"972558578","full_name":"chrisrobison/spectrogram","owner":"chrisrobison","description":"A tool to view the spectrogram of an audio stream or file or to create an audio file containing the spectrogram of a provided image.","archived":false,"fork":false,"pushed_at":"2025-08-12T22:34:02.000Z","size":19762,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-13T00:26:17.911Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/chrisrobison.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}},"created_at":"2025-04-25T09:20:26.000Z","updated_at":"2025-08-12T22:34:05.000Z","dependencies_parsed_at":"2025-08-13T00:25:00.425Z","dependency_job_id":null,"html_url":"https://github.com/chrisrobison/spectrogram","commit_stats":null,"previous_names":["chrisrobison/spectrogram"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chrisrobison/spectrogram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisrobison%2Fspectrogram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisrobison%2Fspectrogram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisrobison%2Fspectrogram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisrobison%2Fspectrogram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisrobison","download_url":"https://codeload.github.com/chrisrobison/spectrogram/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisrobison%2Fspectrogram/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33599499,"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-05-28T02:00:06.440Z","response_time":99,"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":"2026-05-28T08:04:04.218Z","updated_at":"2026-05-28T08:04:09.275Z","avatar_url":"https://github.com/chrisrobison.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎵 Image-to-Audio Spectrogram Visualizer 🎨\n\nA real-time audio visualization tool that converts images to sound and displays spectrograms of audio from various sources (microphone, audio files, or images converted to audio).\n\n![Spectrogram Screenshot](screenshot.png)\n\n## ✨ Features\n\n- **🎤 Multiple Input Sources**:\n  - Microphone input for real-time audio visualization\n  - Audio file upload (.mp3, .wav, etc.)\n  - Image-to-audio conversion with spectrogram display\n  \n- **📊 Real-time Visualization**:\n  - Responsive spectrogram display\n  - Customizable color mapping\n  - Pause/resume functionality\n  \n- **📱 Responsive Design**:\n  - Works on both desktop and mobile devices\n  - Adaptive interface with hamburger menu on small screens\n  \n- **🖼️ Image Processing**:\n  - Server-side image-to-audio conversion\n  - Uses the 'enscribe' command-line tool\n  - Supports common image formats (JPEG, PNG, GIF)\n\n## 🚀 Installation\n\n### Prerequisites\n\n- 🖥️ Web server with PHP support\n- 🛠️ 'enscribe' command-line tool installed on the server\n- 🌐 Modern web browser with Web Audio API support\n\n### Setup\n\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/yourusername/image-to-audio-spectrogram.git\n   cd image-to-audio-spectrogram\n   ```\n\n2. Create required directories:\n   ```bash\n   mkdir uploads\n   mkdir audio\n   ```\n\n3. Set proper permissions:\n   ```bash\n   chmod 755 uploads\n   chmod 755 audio\n   ```\n\n4. Make sure PHP has permission to execute the 'enscribe' command.\n\n5. Deploy to your web server or run locally with PHP's built-in server:\n   ```bash\n   php -S localhost:8000\n   ```\n\n## 🎮 Usage\n\n1. Open the application in your web browser.\n\n2. Choose an input source:\n   - **🎤 Microphone**: Click \"Start Mic\" to use your device's microphone\n   - **🎧 Audio File**: Upload an audio file using the \"Audio File\" button\n   - **🖼️ Image File**: Upload an image to convert to audio using the \"Image File\" button\n\n3. Adjust visualization parameters:\n   - **🌈 Hue**: Changes the color spectrum used in the visualization\n   - **☀️ Base**: Adjusts the base brightness level\n   - **📊 Range**: Controls the dynamic range of brightness\n\n4. Additional controls:\n   - **⏯️ Pause/Resume**: Freezes or continues the visualization\n   - **🧹 Clear**: Resets the visualization display\n\n## ⚙️ How It Works\n\n### Client-Side\n\nThe web application uses the Web Audio API to:\n- Capture audio from the microphone\n- Process audio files\n- Analyze frequency data using an FFT analyzer\n- Visualize the frequency spectrum as a scrolling spectrogram\n\n### Server-Side\n\nThe PHP handler (`enscribe_handler.php`):\n1. Receives uploaded images\n2. Validates file types and sizes\n3. Executes the 'enscribe' command to convert images to audio\n4. Returns the path to the generated audio file\n\n## 🔬 Technical Details\n\n- The spectrogram visualizes frequency data from 0Hz to ~22kHz (depending on sample rate)\n- Frequency data is mapped logarithmically for more natural audio visualization\n- The Web Audio API's AnalyserNode performs real-time FFT analysis\n- Color mapping uses HSL color space for intuitive parameter control\n\n## 🔒 Security Considerations\n\n- File validation prevents upload of unauthorized file types\n- Command execution is protected against injection using `escapeshellcmd()` and `escapeshellarg()`\n- File size limits prevent server resource abuse\n\n## 🔧 Troubleshooting\n\n- **🔇 No audio visualization**: Ensure your browser supports the Web Audio API\n- **🎤 Microphone access denied**: Check browser permissions for microphone access\n- **🖼️ Image processing fails**: Verify the 'enscribe' command is properly installed and accessible to PHP\n- **📱 Blank display on mobile**: Try rotating your device or refreshing the page\n\n## 🌐 Browser Compatibility\n\n- Chrome 70+\n- Firefox 63+\n- Safari 12.1+\n- Edge 79+\n\n## 📄 License\n\n[MIT License](LICENSE)\n\n## 👏 Acknowledgments\n\n- The 'enscribe' tool for image-to-audio conversion\n- Web Audio API for real-time audio processing capabilities\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisrobison%2Fspectrogram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisrobison%2Fspectrogram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisrobison%2Fspectrogram/lists"}