-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Problem Statement
Currently, the Sokuji Electron app only supports Linux platforms with PulseAudio/PipeWire for virtual audio device management. macOS users cannot utilize the desktop application's virtual microphone functionality, which is essential for real-time speech translation in video conferencing applications.
Current State
- ✅ Linux support with PulseAudio/PipeWire virtual audio devices
- ❌ No macOS support for virtual audio devices
- ❌ No macOS-specific audio routing implementation
- ❌ No macOS build configuration in
forge.config.js
Proposed Solution
1. macOS Virtual Audio Device Implementation
Create a macOS-specific audio utility module (electron/coreaudio-utils.js
) that implements:
-
Virtual Audio Driver Integration: Utilize macOS Core Audio framework or third-party solutions like:
- BlackHole - Open source virtual audio driver
- SoundFlower - Legacy but still functional
- VB-Audio Virtual Cable - Commercial solution
-
Audio Routing Functions:
createVirtualAudioDevices()
- Create virtual microphone and speaker devicesremoveVirtualAudioDevices()
- Clean up virtual devicesconnectVirtualSpeakerToOutput()
- Route virtual speaker to system outputdisconnectVirtualSpeakerFromOutputs()
- Disconnect virtual audio routing
2. Platform Detection and Abstraction
Update electron/main.js
to:
- Detect macOS platform (
process.platform === 'darwin'
) - Load appropriate audio utility module based on platform
- Implement platform-specific cleanup handlers
3. Build Configuration Updates
Update forge.config.js
to include macOS build targets:
makers: [
{
name: '@electron-forge/maker-zip',
platforms: ['linux', 'darwin'], // Add macOS support
},
{
name: '@electron-forge/maker-dmg', // Add DMG maker for macOS
config: {
options: {
name: 'Sokuji',
icon: 'assets/icon.icns'
}
}
}
]
4. Dependencies and Requirements
- Add macOS-specific dependencies for audio device management
- Create installation scripts for required virtual audio drivers
- Update documentation with macOS setup instructions
Implementation Details
Core Audio Integration Options
Option A: BlackHole Integration
- Pros: Open source, actively maintained, easy installation
- Cons: Requires separate driver installation
- Implementation: Shell commands to check/install BlackHole, then use Core Audio APIs
Option B: Native Core Audio
- Pros: No external dependencies, full control
- Cons: Complex implementation, requires low-level Core Audio knowledge
- Implementation: Native Node.js addons or shell commands with
SWAudioSession
Option C: Hybrid Approach
- Detect if BlackHole is installed, fall back to native Core Audio
- Provide user-friendly installation prompts
File Structure
electron/
├── main.js (updated with platform detection)
├── pulseaudio-utils.js (existing Linux implementation)
├── coreaudio-utils.js (new macOS implementation)
└── audio-utils.js (platform abstraction layer)
Acceptance Criteria
- macOS users can install and run Sokuji desktop app
- Virtual microphone device is created and available in system audio settings
- Virtual speaker device routes audio to system output
- Audio routing works with popular video conferencing apps (Zoom, Teams, etc.)
- Proper cleanup of virtual devices on app exit
- DMG installer for macOS distribution
- Updated documentation with macOS setup instructions
- Cross-platform compatibility maintained (existing Linux functionality unaffected)
Additional Considerations
Security and Permissions
- macOS may require microphone permissions for virtual audio devices
- Code signing requirements for macOS distribution
- Notarization for macOS Gatekeeper compatibility
User Experience
- Automatic detection and installation prompts for required audio drivers
- Clear error messages for missing dependencies
- System tray integration for macOS (optional)
Testing Requirements
- Test on multiple macOS versions (10.15+)
- Verify compatibility with major video conferencing platforms
- Test audio quality and latency performance
Related Issues
This enhancement would significantly expand Sokuji's user base by supporting macOS users who need real-time speech translation capabilities in their video conferencing workflows.
Priority
High - macOS represents a significant portion of the target user base for professional video conferencing and real-time translation needs.