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
59
60
61
62
63
64
65
66
67
68
69
//! Audio Processing API Implementation
//!
//! Provides access to `HuggingFace`'s audio processing models.
//!
//! ## Features
//!
//! - **Automatic Speech Recognition (ASR)**: Convert speech to text
//! - **Text-to-Speech (TTS)**: Generate speech from text
//! - **Audio Classification**: Classify audio into categories
//! - **Audio-to-Audio**: Transform audio (noise reduction, enhancement, etc.)
//!
//! ## Usage
//!
//! ```no_run
//! # use api_huggingface::{Client, environment::HuggingFaceEnvironmentImpl, secret::Secret};
//! # use api_huggingface::audio::AudioInput;
//! # use std::fs;
//! # async fn example() -> Result< (), Box< dyn std::error::Error > > {
//! # let api_key = Secret::new("test".to_string());
//! # let env = HuggingFaceEnvironmentImpl::build(api_key, None)?;
//! # let client = Client::build(env)?;
//! # let audio = client.audio();
//! // Load audio file
//! let audio_data = fs::read( "speech.wav" )?;
//! let input = AudioInput::from_bytes( audio_data );
//!
//! // Transcribe speech
//! let result = audio.transcribe( input, "openai/whisper-base" ).await?;
//! println!( "Transcription : {}", result );
//! # Ok(())
//! # }
//! ```
pub use *;
use crateClient;
/// Audio API interface
///
/// Provides methods for audio processing tasks using `HuggingFace` models.