stt-cli 0.2.1

Speech to text Cli using Groq API and OpenAI API
// src/audio/commands.rs

//! Defines the commands that can be sent to the audio processing system.

use cpal::{PauseStreamError, PlayStreamError, StreamError};
use futures::channel::oneshot; // Used for acknowledging commands

// / Represents commands sent to control the audio stream.
// #[derive(Debug, Clone)]
// pub enum AudioCommand {
//     /// Start recording using a device specified by its name.
//     /// Includes a oneshot sender to signal completion or error.
//     StartRecordingByName(String, oneshot::Sender<Result<(), String>>),
//     /// Indicates that recording should start (used internally, maybe)
//     /// Usually triggered after device initialization or selection.
//     StartRecording,
//     /// Send captured audio data for processing.
//     ProcessChunk(Vec<f32>),
//     /// Update the configuration of the audio stream (e.g., sample rate).
//     UpdateConfig { sample_rate: u32, channels: u16 },
//     /// Request the current status of the audio stream.
//     GetStatus(oneshot::Sender<AudioStreamStatus>),
// }

// /// Represents the status of the audio stream.
// #[derive(Debug, Clone, PartialEq)]
// pub enum AudioStreamStatus {
//     /// The stream is actively recording audio.
//     Recording,
//     /// The stream is paused.
//     Paused,
//     /// The stream is stopped or not yet started.
//     Stopped,
//     /// The stream encountered an unrecoverable error.
//     Error(String),
// }

// /// Custom error type for audio operations.
// #[derive(Debug, thiserror::Error)]
// pub enum AudioError {
//     #[error("Device error: {0}")]
//     DeviceError(String),

//     #[error("Stream error: {0}")]
//     StreamError(#[from] StreamError),

//     #[error("Failed to play stream: {0}")]
//     PlayStreamError(#[from] PlayStreamError),

//     #[error("Failed to pause stream: {0}")]
//     PauseStreamError(#[from] PauseStreamError),

//     #[error("Command send error: {0}")]
//     CommandSendError(String),

//     #[error("Configuration error: {0}")]
//     ConfigError(String),

//     #[error("Audio processing error: {0}")]
//     ProcessingError(String),

//     #[error("I/O error: {0}")]
//     IoError(#[from] std::io::Error),

//     #[error("No default device found")]
//     NoDefaultDevice,

//     #[error("Device not found: {0}")]
//     DeviceNotFound(String),

//     #[error("Unsupported configuration: {0}")]
//     UnsupportedConfig(String),

//     #[error("Audio buffer error: {0}")]
//     BufferError(String),

//     #[error("Feature not supported: {0}")]
//     FeatureNotSupported(String),

//     #[error("Initialization failed: {0}")]
//     InitializationFailed(String),
// }