azure_speech/recognizer/
mod.rs

1//! Speech to text module.
2//!
3//! This module provides functionality to convert speech to text using Azure Speech Services.
4//!
5//! # Example
6//!
7//! ```compile_fail
8//! use std::env;
9//! use std::path::Path;
10//! use tokio::fs::File;
11//! use tokio::io::{AsyncReadExt, BufReader};
12//!
13//! use azure_speech::Auth;
14//! use azure_speech::recognizer;
15//! use azure_speech::stream::{Stream, StreamExt,wrappers::ReceiverStream};
16//!
17//! #[tokio::main]
18//! async fn main() -> azure_speech::Result<()> {
19//!
20//!     let auth = Auth::from_subscription(
21//!         env::var("AZURE_REGION").expect("Region set on AZURE_REGION env"),
22//!         env::var("AZURE_SUBSCRIPTION_KEY").expect("Subscription set on AZURE_SUBSCRIPTION_KEY env"),
23//!     );
24//!
25//!     let client = recognizer::Client::connect(auth, recognizer::Config::default()).await?;
26//!
27//!     // check in the example folder for how to create the audio stream.
28//!     let audio_stream = create_audio_stream();
29//!     let mut stream = client
30//!         .recognize(audio_stream, recognizer::ContentType::Mp3, recognizer::Details::file())
31//!         .await?;
32//!
33//!     while let Some(event) = stream.next().await {
34//!         tracing::info!("Event: {:?}", event);
35//!     }
36//!
37//!     tracing::info!("Completed!");
38//!
39//!     Ok(())
40//! }
41//!
42
43mod audio_format;
44mod callback;
45mod client;
46mod config;
47mod event;
48mod language;
49mod message;
50mod session;
51mod utils;
52
53pub use audio_format::*;
54pub use callback::*;
55pub use client::*;
56pub use config::*;
57pub use event::*;
58pub use language::*;