| 1 | use gpui::{App, SharedString}; |
| 2 | |
| 3 | use crate::speech::{AudioFormat, RecognitionSession, SpeechError, SpeechRecognizer, SpeechSink}; |
| 4 | |
| 5 | /// Placeholder until the platform recognizer lands. |
| 6 | pub(super) struct PlatformRecognizer; |
| 7 | |
| 8 | impl PlatformRecognizer { |
| 9 | pub(super) fn new(_locale: Option<SharedString>) -> Self { |
| 10 | Self |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | impl SpeechRecognizer for PlatformRecognizer { |
| 15 | fn audio_format(&self) -> AudioFormat { |
| 16 | AudioFormat::default() |
| 17 | } |
| 18 | |
| 19 | fn is_available(&self, _: &App) -> bool { |
| 20 | false |
| 21 | } |
| 22 | |
| 23 | fn start( |
| 24 | &self, |
| 25 | _: SpeechSink, |
| 26 | _: &mut App, |
| 27 | ) -> Result<Box<dyn RecognitionSession>, SpeechError> { |
| 28 | Err(SpeechError::Unsupported) |
| 29 | } |
| 30 | } |