A desktop application for batch audio processing operations, built with Electron. This application provides an easy-to-use graphical interface for trimming, converting, and managing audio files.
- Batch Audio Trimming: Trim multiple audio files to specified durations
- Multiple File Selection: Select individual files or entire directories
- Flexible Output: Choose same directory output or custom output locations
- Progress Tracking: Real-time progress bars and status updates
- Multiple Audio Formats: Support for MP3, M4A, WAV, FLAC, AAC files
- Format Conversion: Convert batches of MP3, M4A, WAV, and AAC files to any of the other supported formats
- Audio Extraction: Extract precise segments from one file or entire folders with start/end timestamps, stream-copy mode, and advanced audio controls
- Merge Media: Drag-and-drop multiple audio clips, reorder them visually, and merge with optional stream copy or re-encoding controls
- History/Logs: Automatically track every change locally so you can review what happened at any time
- Automatic FFmpeg Handling: Bundled FFmpeg binaries for easy setup
- Cross-platform: Works on Windows, macOS, and Linux
-
Clone or download this repository
git clone <repository-url> cd ffmpeg-script-for-auto-trimming-multiple-files
-
Install dependencies
npm install
-
Start the application
npm start
- Node.js (v14 or higher)
- npm (comes with Node.js)
The application will automatically handle FFmpeg installation. If FFmpeg is not found on your system, it will use bundled binaries.
- Launch the application using
npm start - Select files using one of these methods:
- Click "Select Files" to choose individual audio files
- Click "Select Directory" to process all audio files in a folder
- Configure settings:
- Set trim duration (default: 30 minutes)
- Choose output location (same directory or custom)
- Click "Start Processing" to begin batch trimming
- MP3 (.mp3)
- M4A (.m4a)
- WAV (.wav)
- FLAC (.flac)
- AAC (.aac)
- Same Directory: Trimmed files are saved alongside originals with "_trimmed" suffix
- Custom Directory: Choose a different output location for all processed files
- Navigate to the Convert Format tab in the sidebar
- Select individual files or load every supported file in a directory
- Choose the desired target format (MP3, M4A, WAV, or AAC)
- Optional: set a custom suffix and destination directory
- Click Start Conversion to batch-convert the selected files
- Open the Extract Audio tab in the sidebar
- Select specific files or load every supported file from a directory
- Enter a start time and end time (HH:MM:SS) to define the clip window
- Choose the desired output format and suffix (defaults to
_extract) - (Optional) Configure codec, bitrate, sample rate, channel count, track mapping (
-map), or provide a custom filter graph - Select Copy original stream to use
-c copyand avoid re-encoding when the container/codec already match - Optionally route clips to a custom directory
- Click Extract Audio to generate clipped audio segments for all selected inputs
- Switch to the Merge Media tab
- Drag & drop audio files into the mini GUI or click Select Files
- Reorder clips (top to bottom) using the Up/Down controls; remove any unwanted entries
- Pick the output format and optional codec/bitrate/sample-rate/filter overrides
- Choose Copy original stream to attempt a fast
-c copymerge when all files share the same codec/container - Set an output suffix and directory preference
- Click Merge Audio to concatenate every file into a single track
- Visit the History/Logs tab to review all actions performed in the app
- Entries are added automatically whenever you change settings, select files, or run operations
- Use Clear History to reset the log if desired (a new entry will note the clear action)
- Note: The full history stays on your device only and is not transmitted anywhere
npm start- Launch the application in development modenpm run build- Build the application for distributionnpm test- Run tests (currently no tests configured)
├── main.js # Electron main process
├── preload.js # Preload script for security
├── src/
│ ├── index.html # Main UI
│ ├── renderer.js # Frontend logic
│ └── styles.css # Application styles
├── services/
│ ├── ffmpeg.js # Audio processing service
│ └── database.js # Data persistence
└── script_trim_30min.bat # Legacy batch script
To create a distributable version of the application:
npm run buildThis will create platform-specific installers in the dist/ directory.
- The application automatically detects and configures FFmpeg
- If FFmpeg fails to install automatically, download it from ffmpeg.org
- Add FFmpeg to your system PATH or place binaries in the project root
- Application won't start: Ensure Node.js v14+ is installed
- No audio files found: Check file extensions are supported (MP3, M4A, WAV, FLAC, AAC)
- Processing fails: Verify input files are not corrupted and have proper permissions
For command-line usage, a legacy batch script (script_trim_30min.bat) is included:
- Edit the script to set your directory path
- Modify file extensions if needed (currently set to .m4a)
- Run the batch file directly
MIT License - see package.json for details
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request