fix: improve voice and chat controls
This commit is contained in:
@@ -67,6 +67,7 @@ class VoiceSettingsDialog extends StatefulWidget {
|
||||
this.pttLevel = '',
|
||||
this.pttBackendId = '',
|
||||
this.pttBoundInputClass = '',
|
||||
this.onnxRuntimeAvailable = true,
|
||||
this.talkPower,
|
||||
this.neededTalkPower,
|
||||
this.talkPowerGranted,
|
||||
@@ -78,6 +79,7 @@ class VoiceSettingsDialog extends StatefulWidget {
|
||||
final String pttLevel;
|
||||
final String pttBackendId;
|
||||
final String pttBoundInputClass;
|
||||
final bool onnxRuntimeAvailable;
|
||||
final int? talkPower;
|
||||
final int? neededTalkPower;
|
||||
final bool? talkPowerGranted;
|
||||
@@ -101,6 +103,10 @@ class _VoiceSettingsDialogState extends State<VoiceSettingsDialog> {
|
||||
_audioProcessing = AudioProcessingConfigState.fromConfig(
|
||||
widget.initialAudioConfig,
|
||||
);
|
||||
_audioProcessing.vadBackend = normalizedVadBackend(
|
||||
_audioProcessing.vadBackend,
|
||||
onnxRuntimeAvailable: widget.onnxRuntimeAvailable,
|
||||
);
|
||||
}
|
||||
|
||||
rust.BridgeAudioProcessingConfig _buildConfig() {
|
||||
@@ -291,17 +297,24 @@ class _VoiceSettingsDialogState extends State<VoiceSettingsDialog> {
|
||||
const VoiceSubHeader('Backend'),
|
||||
SegmentedButton<rust.BridgeVadBackend>(
|
||||
style: voiceSegmentedButtonStyle(theme),
|
||||
segments: _isDesktopSileroVadHost
|
||||
? desktopVadBackendSegments
|
||||
: vadBackendSegments,
|
||||
segments: vadBackendSegmentsForAvailability(
|
||||
desktop: _isDesktopSileroVadHost,
|
||||
onnxRuntimeAvailable: widget.onnxRuntimeAvailable,
|
||||
),
|
||||
selected: {_audioProcessing.vadBackend},
|
||||
onSelectionChanged: (s) =>
|
||||
setState(() => _audioProcessing.vadBackend = s.first),
|
||||
onSelectionChanged: (s) => setState(
|
||||
() => _audioProcessing.vadBackend = normalizedVadBackend(
|
||||
s.first,
|
||||
onnxRuntimeAvailable: widget.onnxRuntimeAvailable,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
if (_isDesktopSileroVadHost)
|
||||
Text(
|
||||
'Silero gives the best quality when ONNX Runtime is installed. WebRTC works without ONNX Runtime and is the safer fallback if Linux setup is incomplete.',
|
||||
widget.onnxRuntimeAvailable
|
||||
? 'Silero gives the best quality when ONNX Runtime is installed. WebRTC works without ONNX Runtime and is the safer fallback if Linux setup is incomplete.'
|
||||
: 'Silero is unavailable because ONNX Runtime was not found. WebRTC is selected until libonnxruntime.so is installed or bundled.',
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user