Skip to content

Commit

Permalink
style: format code for improved readability in tts.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
thewh1teagle committed Jan 18, 2025
1 parent cf33212 commit fb39cfd
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions crates/sherpa-rs/src/tts.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::ptr::null;

use crate::{ get_default_provider, utils::RawCStr };
use eyre::{ bail, Result };
use hound::{ WavSpec, WavWriter };
use crate::{get_default_provider, utils::RawCStr};
use eyre::{bail, Result};
use hound::{WavSpec, WavWriter};

#[derive(Debug)]
pub struct OfflineTtsConfig {
Expand Down Expand Up @@ -118,12 +118,8 @@ impl OfflineTts {
pub fn generate(&mut self, text: String, sid: i32, speed: f32) -> Result<TtsSample> {
unsafe {
let text = RawCStr::new(&text);
let audio_ptr = sherpa_rs_sys::SherpaOnnxOfflineTtsGenerate(
self.tts,
text.as_ptr(),
sid,
speed
);
let audio_ptr =
sherpa_rs_sys::SherpaOnnxOfflineTtsGenerate(self.tts, text.as_ptr(), sid, speed);

if audio_ptr.is_null() {
bail!("audio is null");
Expand Down

0 comments on commit fb39cfd

Please sign in to comment.