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