feat: added an option to allow user choose whether to trim leading silence when bouncing audio
This commit is contained in:
@@ -14,6 +14,7 @@ const BehaviorSettings: React.FC = () => {
|
||||
const [midiAutomationInterpolationIntervalMs, setMidiAutomationInterpolationIntervalMs] = useState<number>(10);
|
||||
const [playbackDelay, setPlaybackDelay] = useState<string>('200');
|
||||
const [recordingOffset, setRecordingOffset] = useState<string>('0');
|
||||
const [bounceStartsFromBeat1, setBounceStartsFromBeat1] = useState<boolean>(true);
|
||||
const [enableAudioCapture, setEnableAudioCapture] = useState<boolean>(false);
|
||||
const [lookaheadValidationErrors, setLookaheadValidationErrors] = useState<string[]>([]);
|
||||
const [playbackDelayValidationErrors, setPlaybackDelayValidationErrors] = useState<string[]>([]);
|
||||
@@ -42,6 +43,7 @@ const BehaviorSettings: React.FC = () => {
|
||||
setPlaybackDelay(((playbackDelaySeconds * 1000).toFixed(0)));
|
||||
const recordingOffsetSeconds = (configManager.get('audio.recording_offset') as number) ?? 0;
|
||||
setRecordingOffset(((recordingOffsetSeconds * 1000).toFixed(0)));
|
||||
setBounceStartsFromBeat1((configManager.get('audio.bounce_starts_from_beat_1') as boolean) ?? true);
|
||||
setEnableAudioCapture((configManager.get('audio.enable_audio_capture_for_screen_sharing') as boolean) ?? false);
|
||||
};
|
||||
|
||||
@@ -158,6 +160,12 @@ const BehaviorSettings: React.FC = () => {
|
||||
await configManager.set('audio.enable_audio_capture_for_screen_sharing', boolValue);
|
||||
};
|
||||
|
||||
const handleBounceStartsFromBeat1Change = async (value: string) => {
|
||||
const boolValue = value === 'yes';
|
||||
setBounceStartsFromBeat1(boolValue);
|
||||
await configManager.set('audio.bounce_starts_from_beat_1', boolValue);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="settings-section">
|
||||
<div className="settings-section-header">
|
||||
@@ -325,6 +333,23 @@ const BehaviorSettings: React.FC = () => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="settings-item">
|
||||
<label className="settings-label">
|
||||
Bounce Starts From Beat 1
|
||||
</label>
|
||||
<select
|
||||
className="settings-select"
|
||||
value={bounceStartsFromBeat1 ? 'yes' : 'no'}
|
||||
onChange={(e) => handleBounceStartsFromBeat1Change(e.target.value)}
|
||||
>
|
||||
<option value="no">No</option>
|
||||
<option value="yes">Yes</option>
|
||||
</select>
|
||||
<div className="settings-help" style={{ fontSize: '12px', color: '#888', marginTop: '4px' }}>
|
||||
Yes includes leading silence from the start of the song up to the first rendered region when bouncing WAV/MP3. No trims that leading silence and starts bounce at the first rendered note or audio region.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="settings-item">
|
||||
<label className="settings-label">
|
||||
Capture Audio for Screen Sharing
|
||||
|
||||
Reference in New Issue
Block a user