Spaces:
Sleeping
Sleeping
Commit ·
137e299
1
Parent(s): 6ebd8cd
fix: broken imports
Browse filesFiles changed (10)
- .github/ISSUE_TEMPLATE/bug_report.ymlAdded+69
- .github/SECURITY.mdAdded+15
- .github/pull_request_template.mdAdded+37
- LICENSEAdded+21
- README.md+71-1
- docs/CODE_OF_CONDUCT.mdAdded+41
- docs/CONTRIBUTING.mdAdded+58
- pyproject.tomlAdded+29
- src/trimly/__init__.pyAdded+1
- src/trimly/core.pyAdded+34
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869name: Bug Reportdescription: Report a problem with Trimlytitle: "[Bug]: "labels: ["bug"]assignees: - usamaraajput
body: - type: markdown attributes: value: | Thanks for helping improve Trimly! Please complete the following so we can reproduce and fix the bug.
- type: input id: bug_summary attributes: label: Bug Summary description: Briefly describe the issue placeholder: e.g. "Crash when processing input text" validations: required: true
- type: textarea id: reproduction_steps attributes: label: Steps to Reproduce description: What are the exact steps to trigger this bug? placeholder: | 1. ... 2. ... 3. ... validations: required: true
- type: textarea id: expected_behavior attributes: label: Expected Behavior description: What did you expect to happen? placeholder: e.g. "The output audio should have included chunk 3" validations: required: true
- type: textarea id: actual_behavior attributes: label: Actual Behavior description: What actually happened? placeholder: e.g. "It skipped chunk 3 entirely" validations: required: true
- type: input id: system_info attributes: label: System Info description: OS, Python/Go version, FFmpeg version, etc. placeholder: e.g. "Windows 11, Python 3.11.4, FFmpeg 6.1" validations: required: false
- type: textarea id: additional_context attributes: label: Additional Context description: Logs, screenshots, or anything else useful placeholder: Paste logs or explain further if needed validations: required: false123456789101112131415# Security Policy
## Reporting a Vulnerability
If you discover a security vulnerability in **Trimly**, please **do not** open a public issue.
Instead, report it confidentially by emailing:
📧 **hello@usamaraajput.com**
We will review and respond to security reports as quickly as possible. Responsible disclosure is respected and appreciated.
---
**Note:** If the issue has already been publicly disclosed, link it in your message so we can prioritize appropriately.12345678910111213141516171819202122232425262728293031323334353637# Pull Request
## What’s Changed?
<!-- Briefly summarize the changes in this PR -->
- [ ] Feature- [ ] Bugfix- [ ] Refactor- [ ] Documentation- [ ] Other (please describe)
## Description
<!-- Describe what this PR does and why it matters -->
## Related Issues
<!-- If this PR closes an issue, reference it like so: -->
Closes #123
## Checklist
- [ ] I’ve followed the coding style and guidelines- [ ] I’ve tested my changes locally- [ ] I’ve added/updated relevant tests if needed- [ ] I’ve updated docs if needed- [ ] My changes are focused and minimal
## Screenshots (if applicable)
<!-- UI changes? Paste screenshots or screen recordings here -->
## Notes for Reviewers
<!-- Anything the reviewers should pay special attention to? -->123456789101112131415161718192021MIT License
Copyright (c) 2025 Logic Weaver, Trimly
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.10 unmodified lines1112131410 unmodified linesshort_description: Fast, automated silence trimming for voiceover files — power---Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference10 unmodified lines111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838410 unmodified linesshort_description: Fast, automated silence trimming for voiceover files — power---# Trimly[](https://github.com/LogicWeaver/trimly/releases)[](LICENSE)[](https://www.python.org/downloads/)[](https://ffmpeg.org/)[](https://www.gradio.app/)**Silence Trimmer for Voiceovers — powered by FFmpeg, Python & Gradio**Trimly is a smart, minimalist tool for cutting long pauses and dead air from audio. It’s perfect for podcasters, voice actors, audiobook narrators — or anyone who wants cleaner, tighter voice recordings with zero editing.🚀 [**Live Demo on Hugging Face Spaces →**](https://huggingface.co/spaces/your-username/trimly)## Features- ⚡ Fast silence removal using `ffmpeg` under the hood- 🎚️ Customizable threshold and minimum pause length- 🧠 Simple, clean web UI built with Gradio- 🔊 Works with `.mp3` and `.wav` files- 🧼 Zero editing experience required## Getting Started### 1. Clone the repo```bashgit clone https://github.com/LogicWeaver/trimly.gitcd trimly```### 2. (Optional) Create a virtual environment```bashpython -m venv venvsource venv/bin/activate # Windows: venv\Scripts\activate```### 3. Install dependencies```bashpip install .```### 4. Launch the app```bashpython app.py```Trimly will launch in your default browser.## How It WorksTrimly uses FFmpeg’s `silenceremove` filter to detect and trim silent segments. You control how it behaves:- **Silence Threshold (dB)**: How quiet is “silent”?- **Minimum Silence Duration (sec)**: How long before it gets chopped?This lets you remove awkward gaps from voiceovers with surgical precision.## ContributingContributions are welcome! Whether you're fixing bugs, adding features, or improving documentation, your input helps make Trimly better for everyone.- Read the [Contributing Guidelines](docs/CONTRIBUTING.md)- Follow the [Code of Conduct](docs/CODE_OF_CONDUCT.md)## LicenseTrimly is released under the MIT License. For the full license text, please see the [LICENSE](LICENSE) file.
1234567891011121314151617181920212223242526272829303132333435363738394041# Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment:
- Demonstrating empathy and kindness toward other people- Being respectful of differing opinions, viewpoints, and experiences- Giving and gracefully accepting constructive feedback- Accepting responsibility and apologizing to those affected by our mistakes- Focusing on what is best for the community
Examples of unacceptable behavior:
- The use of sexualized language or imagery and unwelcome sexual attention or advances- Trolling, insulting/derogatory comments, and personal or political attacks- Public or private harassment- Publishing others' private information without explicit permission- Other conduct which could reasonably be considered inappropriate in a professional setting
## Enforcement Responsibilities
Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies within all community spaces and also when an individual is representing the community in public spaces.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project maintainers. All complaints will be reviewed and investigated promptly and fairly.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758# Contributing to Trimly
Thanks for your interest in contributing to **Trimly**, a Logic Weaver project. We welcome pull requests, issues, and ideas — as long as they push the project forward with clarity and quality.
## Code of Conduct
Please make sure to review and follow our [Code of Conduct](CODE_OF_CONDUCT.md) before contributing.
## How to Contribute
### 1. Fork the Repo
Create your own fork of the repository and clone it locally:
```bashgit clone https://github.com/LogicWeaver/trimly.gitcd trimly```
### 2. Create a Feature Branch
Use a clear, descriptive branch name:
```bashgit checkout -b feature/your-feature-name```
### 3. Make Your Changes
Write clean, idiomatic code. Stick to project conventions. Add tests if applicable. No dead code. No “just messing around” commits.
### 4. Commit Smart
Use clear, conventional commit messages. Follow this pattern:
```bashtype(scope): short summaryex: feat(chunking): add adaptive sentence segmentation```
### 5. Push and Open a Pull Request
Push your branch and open a pull request. Fill out the [PR template](https://github.com/LogicWeaver/trimly/blob/main/.github/pull_request_template.md), describe what you did, and link any related issues.
## PR Guidelines
- Keep pull requests focused and minimal- Include a short summary of what you’ve changed- Feel free to open a Draft PR early for discussion or feedback- Always test your UI changes before submitting
## Reporting Bugs
If you find a bug:
1. Open a GitHub issue2. Describe what went wrong and steps to reproduce it3. Include the OS, Python version, FFmpeg version, etc.1234567891011121314151617181920212223242526272829[build-system]requires = ["setuptools>=61.0"]build-backend = "setuptools.build_meta"
[project]name = "trimly"version = "0.0.1"description = "Trimly - Remove pauses from voiceovers"authors = [ { name = "Usama Arshad", email = "hello@usamaraajput.com" }]readme = "README.md"license = { text = "MIT" }requires-python = ">=3.10"dependencies = [ "ffmpeg-python", "gradio"]keywords = ["voiceover", "pause-removal", "ffmpeg", "gradio"]
[project.urls]Homepage = "https://github.com/LogicWeaver/trimly"Repository = "https://github.com/LogicWeaver/trimly"
[tool.setuptools]package-dir = { "" = "src" }
[tool.setuptools.packages.find]where = ["src"]1from .core import trim_audio, clean_tmp12345678910111213141516171819202122232425262728293031323334import osimport subprocess
TMP_DIR = "tmp"os.makedirs(TMP_DIR, exist_ok=True)
def clean_tmp(): for f in os.listdir(TMP_DIR): fp = os.path.join(TMP_DIR, f) if os.path.isfile(fp): os.remove(fp)
def trim_audio(file, threshold, min_silence): if file is None: return "No file provided", None
filename = os.path.basename(file) name, ext = os.path.splitext(filename)
if name.startswith("enhanced"): return f"⚠️ Skipped '{filename}' (already enhanced).", None
output_path = os.path.join(TMP_DIR, f"enhanced_{name}.wav")
cmd = [ "ffmpeg", "-y", "-i", file, "-af", f"silenceremove=start_periods=1:start_silence=0.1:start_threshold={threshold}dB:" f"stop_periods=-1:stop_silence={min_silence}:stop_threshold={threshold}dB:detection=peak", output_path ]
subprocess.run(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
return f"✅ Trimmed successfully → enhanced_{name}.wav", output_path.github/ISSUE_TEMPLATE/bug_report.ymlAdded+69
.github/SECURITY.mdAdded+15
.github/pull_request_template.mdAdded+37
LICENSEAdded+21
README.md+71-1
docs/CODE_OF_CONDUCT.mdAdded+41
docs/CONTRIBUTING.mdAdded+58
pyproject.tomlAdded+29
src/trimly/__init__.pyAdded+1
src/trimly/core.pyAdded+34