Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 35 additions & 124 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ hypr-template = { path = "crates/template", package = "template" }
hypr-transcribe-aws = { path = "crates/transcribe-aws", package = "transcribe-aws" }
hypr-transcribe-azure = { path = "crates/transcribe-azure", package = "transcribe-azure" }
hypr-transcribe-gcp = { path = "crates/transcribe-gcp", package = "transcribe-gcp" }
hypr-transcribe-whisper-local = { path = "crates/transcribe-whisper-local", package = "transcribe-whisper-local" }
hypr-turso = { path = "crates/turso", package = "turso" }
hypr-whisper = { path = "crates/whisper", package = "whisper" }
hypr-whisper-cloud = { path = "crates/whisper-cloud", package = "whisper-cloud" }
Expand Down
2 changes: 2 additions & 0 deletions crates/transcribe-aws/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ tracing = { workspace = true }
aws-config = "1.8.3"
aws-sdk-transcribe = "1.83.0"
aws-sdk-transcribestreaming = "1.80.0"
aws-smithy-runtime-api = "1.8.5"
aws-smithy-types = "1.3.2"

[dev-dependencies]
hypr-data = { workspace = true }
22 changes: 18 additions & 4 deletions crates/transcribe-aws/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Invalid input: {0}")]
InvalidInput(String),
#[error("Service error: {0}")]
ServiceError(String),
#[error(transparent)]
GenericError(#[from] aws_sdk_transcribestreaming::Error),
#[error(transparent)]
TranscriptResultStreamError(
#[from]
aws_smithy_runtime_api::client::result::SdkError<
aws_sdk_transcribestreaming::types::error::TranscriptResultStreamError,
aws_smithy_types::event_stream::RawMessage,
>,
),
#[error(transparent)]
StartStreamTranscriptionError(
#[from]
aws_smithy_runtime_api::client::result::SdkError<
aws_sdk_transcribestreaming::operation::start_stream_transcription::StartStreamTranscriptionError,
aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
),
}
9 changes: 5 additions & 4 deletions crates/transcribe-aws/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// AWS draft

use bytes::Bytes;
use serde::{Deserialize, Serialize};
use std::sync::Arc;
Expand Down Expand Up @@ -28,7 +30,7 @@ use aws_sdk_transcribestreaming::primitives::Blob;
use aws_sdk_transcribestreaming::types::{
AudioEvent, AudioStream, LanguageCode, MediaEncoding, TranscriptResultStream,
};
use aws_sdk_transcribestreaming::{config::Region, Client, Error};
use aws_sdk_transcribestreaming::{config::Region, Client};

mod error;
pub use error::*;
Expand Down Expand Up @@ -72,7 +74,7 @@ pub struct TranscribeService {
}

impl TranscribeService {
pub async fn new(config: TranscribeConfig) -> Result<Self, Error> {
pub async fn new(config: TranscribeConfig) -> Result<Self, crate::Error> {
let region_provider =
RegionProviderChain::first_try(config.region.clone().map(Region::new))
.or_default_provider()
Expand Down Expand Up @@ -143,7 +145,7 @@ impl TranscribeService {
&self,
mut audio_rx: mpsc::Receiver<Bytes>,
result_tx: mpsc::Sender<WsMessage>,
) -> Result<(), Error> {
) -> Result<(), crate::Error> {
// Create audio stream for AWS Transcribe
let input_stream = stream! {
while let Some(chunk) = audio_rx.recv().await {
Expand All @@ -166,7 +168,6 @@ impl TranscribeService {
.send()
.await?;

// Process transcription results
while let Some(event) = output.transcript_result_stream.recv().await? {
match event {
TranscriptResultStream::TranscriptEvent(transcript_event) => {
Expand Down
9 changes: 9 additions & 0 deletions crates/transcribe-interface/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "transcribe-interface"
version = "0.1.0"
edition = "2021"

[dependencies]
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
thiserror = { workspace = true }
1 change: 1 addition & 0 deletions crates/transcribe-interface/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

38 changes: 38 additions & 0 deletions crates/transcribe-whisper-local/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[package]
name = "transcribe-whisper-local"
version = "0.1.0"
edition = "2021"

[features]
default = []
coreml = ["hypr-whisper-local/coreml"]
directml = ["hypr-pyannote-local/directml"]
cuda = ["hypr-whisper-local/cuda"]
hipblas = ["hypr-whisper-local/hipblas"]
openblas = ["hypr-whisper-local/openblas"]
metal = ["hypr-whisper-local/metal"]
vulkan = ["hypr-whisper-local/vulkan"]
openmp = ["hypr-whisper-local/openmp"]
load-dynamic = ["hypr-pyannote-local/load-dynamic"]

[dependencies]
hypr-audio-utils = { workspace = true }
hypr-chunker = { workspace = true }
hypr-listener-interface = { workspace = true }
hypr-pyannote-local = { workspace = true }
hypr-whisper = { workspace = true }
hypr-whisper-local = { workspace = true }
hypr-ws-utils = { workspace = true }

serde_json = { workspace = true }
serde_qs = { workspace = true }
thiserror = { workspace = true }

axum = { workspace = true, features = ["ws"] }
futures-util = { workspace = true }
tokio = { workspace = true }
tokio-util = { workspace = true }
tower = { workspace = true }
tracing = { workspace = true }

rodio = { workspace = true }
2 changes: 2 additions & 0 deletions crates/transcribe-whisper-local/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#[derive(Debug, thiserror::Error)]
pub enum Error {}
6 changes: 6 additions & 0 deletions crates/transcribe-whisper-local/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mod error;
mod manager;
mod service;

pub use error::*;
pub use service::*;
Loading
Loading