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
8 changes: 4 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Docker Image CI

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

env:
REGISTRY: ghcr.io
Expand All @@ -31,9 +31,9 @@ jobs:
- name: Build Binaries
run: |
# Build x86
cross build --release --target x86_64-unknown-linux-gnu
cross build --release --target x86_64-unknown-linux-gnu --features aws-lc-bindgen
# Build ARM64
cross build --release --target aarch64-unknown-linux-gnu
cross build --release --target aarch64-unknown-linux-gnu --features aws-lc-bindgen

# Organize binaries for Docker Packaging
mkdir -p bin/amd64 bin/arm64
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ categories = ["network-programming", "multimedia"]
opus = ["dep:opusic-sys"]
default = ["opus"]
not_vad = []
aws-lc-bindgen = ["aws-lc-rs/bindgen"]

[dependencies]
opusic-sys = { version = "0.5.8", optional = true }
Expand All @@ -30,7 +31,7 @@ axum = { version = "0.8.7", features = ["ws", "tokio", "multipart"] }
tower-http = { version = "0.6.2", features = ["fs", "trace"] }
bytes = "1"
futures = "0.3.31"
rustls = { version = "0.23.36", features = ["ring"] }
rustls = "0.23.36"
dotenvy = "0.15.7"
clap = { version = "4.5.54", features = ["derive"] }
chrono = { version = "0.4.42", features = ["serde"] }
Expand Down Expand Up @@ -71,7 +72,6 @@ nnnoiseless = "0.5.2"
hound = "3.5.1"
get_if_addrs = "0.5.3"
http = "1.4.0"
ring = "0.17.14"
urlencoding = "2.1.3"
base64 = "0.22.1"
url = "2.5.8"
Expand All @@ -80,7 +80,7 @@ realfft = "3.3"
rmp3 = "0.3"
tempfile = "3.24.0"
# Workaround for cross-compilation - generate bindings at compile time
#aws-lc-rs = { version = "1", features = ["bindgen"] }
aws-lc-rs = "1"

[dev-dependencies]
tempfile = "3.23.0"
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub async fn index() -> impl IntoResponse {

#[tokio::main]
async fn main() -> Result<()> {
rustls::crypto::ring::default_provider()
rustls::crypto::aws_lc_rs::default_provider()
.install_default()
.expect("Failed to install rustls crypto provider");

Expand Down
2 changes: 1 addition & 1 deletion src/synthesis/tencent_cloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ use super::{SynthesisClient, SynthesisOption, SynthesisType};
use crate::synthesis::{Subtitle, SynthesisEvent};
use anyhow::Result;
use async_trait::async_trait;
use aws_lc_rs::hmac;
use base64::{Engine, prelude::BASE64_STANDARD};
use chrono::Duration;
use futures::{
SinkExt, Stream, StreamExt, future,
stream::{self, BoxStream, SplitSink},
};
use ring::hmac;
use serde::{Deserialize, Serialize};
use std::sync::Arc;
use tokio::{
Expand Down
2 changes: 1 addition & 1 deletion src/synthesis/tencent_cloud_basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ use super::{SynthesisClient, SynthesisOption, SynthesisType};
use crate::synthesis::{SynthesisEvent, tencent_cloud::TencentSubtitle};
use anyhow::Result;
use async_trait::async_trait;
use aws_lc_rs::hmac;
use base64::{Engine, prelude::BASE64_STANDARD};
use bytes::Bytes;
use futures::{
FutureExt, StreamExt, future,
stream::{self, BoxStream},
};
use rand::Rng;
use ring::hmac;
use serde::Deserialize;
use tokio::sync::mpsc;
use tokio_stream::wrappers::UnboundedReceiverStream;
Expand Down
9 changes: 6 additions & 3 deletions src/synthesis/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ fn get_deepgram_credentials() -> Option<String> {
#[tokio::test]
async fn test_tencent_cloud_tts() {
// Initialize crypto provider
rustls::crypto::CryptoProvider::install_default(rustls::crypto::ring::default_provider()).ok();
rustls::crypto::CryptoProvider::install_default(rustls::crypto::aws_lc_rs::default_provider())
.ok();

let (secret_id, secret_key, app_id) = match get_tencent_credentials() {
Some(creds) => creds,
Expand Down Expand Up @@ -194,7 +195,8 @@ async fn test_tencent_cloud_tts() {
#[tokio::test]
async fn test_aliyun_tts() {
// Initialize crypto provider
rustls::crypto::CryptoProvider::install_default(rustls::crypto::ring::default_provider()).ok();
rustls::crypto::CryptoProvider::install_default(rustls::crypto::aws_lc_rs::default_provider())
.ok();

let api_key = match get_aliyun_credentials() {
Some(key) => key,
Expand Down Expand Up @@ -227,7 +229,8 @@ async fn test_aliyun_tts() {

#[tokio::test]
async fn test_deepgram_tts() {
rustls::crypto::CryptoProvider::install_default(rustls::crypto::ring::default_provider()).ok();
rustls::crypto::CryptoProvider::install_default(rustls::crypto::aws_lc_rs::default_provider())
.ok();

let api_key = match get_deepgram_credentials() {
Some(key) => key,
Expand Down
2 changes: 1 addition & 1 deletion src/transcription/tencent_cloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ use crate::transcription::{
use anyhow::{Result, anyhow};
use async_trait::async_trait;
use audio_codec::{Sample, samples_to_bytes};
use aws_lc_rs::hmac;
use base64::{Engine, prelude::BASE64_STANDARD};
use chrono;
use futures::{SinkExt, StreamExt};
use http::{Request, StatusCode, Uri};
use rand::random;
use ring::hmac;
use serde::{Deserialize, Serialize};
use std::future::Future;
use std::pin::Pin;
Expand Down
2 changes: 1 addition & 1 deletion src/transcription/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
};
use dotenvy::dotenv;
use once_cell::sync::OnceCell;
use rustls::crypto::ring::default_provider;
use rustls::crypto::aws_lc_rs::default_provider;
use std::{collections::HashMap, env};
use tokio::time::{Duration, timeout};

Expand Down