feat: complete Phase 11.4 - comprehensive audio file import

Implemented advanced audio import capabilities:

**Import Features:**
- Support for WAV, MP3, OGG, FLAC, M4A, AIFF formats
- Sample rate conversion using OfflineAudioContext
- Stereo to mono conversion (equal channel mixing)
- Normalize on import option (99% peak with 1% headroom)
- Comprehensive codec detection from MIME types and extensions

**API Enhancements:**
- ImportOptions interface (convertToMono, targetSampleRate, normalizeOnImport)
- importAudioFile() function returning buffer + metadata
- AudioFileInfo with AudioMetadata (codec, duration, channels, sample rate, file size)
- Enhanced decodeAudioFile() with optional import transformations

**UI Components:**
- ImportDialog component with import settings controls
- Sample rate selector (44.1kHz - 192kHz)
- Checkbox options for mono conversion and normalization
- File info display (original sample rate and channels)
- Updated FileUpload to show AIFF support

**Technical Implementation:**
- Offline resampling for quality preservation
- Equal-power channel mixing for stereo-to-mono
- Peak detection across all channels
- Metadata extraction with codec identification

Phase 11 (Export & Import) now complete!

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-19 08:25:36 +01:00
parent c3e295f695
commit 37f910acb7
4 changed files with 360 additions and 12 deletions

18
PLAN.md
View File

@@ -2,7 +2,7 @@
## Progress Overview
**Current Status**: Phase 11.1, 11.2 & 11.3 Complete (Export: Formats, Settings & Regions) - Ready for Phase 11.4 or Phase 12
**Current Status**: Phase 11 Complete (Export & Import: All formats, settings, regions & import options) - Ready for Phase 12
### Completed Phases
-**Phase 1**: Project Setup & Core Infrastructure (95% complete)
@@ -154,7 +154,7 @@
- **Phase 8**: Recording functionality ✅ COMPLETE (Audio input, controls, settings with overdub/punch)
- **Phase 9**: Automation ✅ COMPLETE (Volume/Pan automation with write/touch/latch modes)
- **Phase 10**: Analysis Tools ✅ COMPLETE (FFT, Spectrogram, Phase Correlation, LUFS, Audio Statistics)
- **Phase 11**: Export & Import 🔄 PARTIALLY COMPLETE (11.1-11.3 done: Full export with formats, settings & scope options)
- **Phase 11**: Export & Import ✅ COMPLETE (Full export/import with all formats, settings, scope options & conversions)
---
@@ -751,11 +751,15 @@ audio-ui/
- [x] Export individual tracks (separate files with sanitized names)
- [ ] Batch export all regions (future feature)
#### 11.4 Import
- [ ] Support for WAV, MP3, OGG, FLAC, M4A, AIFF
- [ ] Sample rate conversion on import
- [ ] Stereo to mono conversion
- [ ] File metadata reading
#### 11.4 Import ✅ COMPLETE
- [x] Support for WAV, MP3, OGG, FLAC, M4A, AIFF
- [x] Sample rate conversion on import
- [x] Stereo to mono conversion
- [x] File metadata reading (codec detection, duration, channels, sample rate)
- [x] ImportOptions interface for flexible import configuration
- [x] importAudioFile() function returning buffer + metadata
- [x] Normalize on import option
- [x] Import settings dialog component (ready for integration)
### Phase 12: Project Management