Skip to content

jpreprocess/htsengine-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

htsengine-rs

Rust binding of hts_engine_API (SourceForge)

Example

use htsengine::HTSEngine;

let fullcontext_label = vec![
    /* fullcontext labels (String) */
];

let mut engine = HTSEngine::new();
engine.load(vec!["nitech_jp_atr503_m001.htsvoice".to_string()])?;
engine.set_sampling_frequency(48000);

let result = engine
    .synthesize(fullcontext_label)?
    .into_iter()
    .map(|d| {
        if d < (i16::MIN as f64) {
            i16::MIN
        } else if d > (i16::MAX as f64) {
            i16::MAX
        } else {
            d as i16
        }
    })
    .collect();

let mut out_file = File::create("out.wav")?;
wav::write(
    wav::Header::new(wav::WAV_FORMAT_PCM, 1, 48000, 16),
    &wav::BitDepth::Sixteen(result),
    &mut out_file,
)?;

Copyright Notice

See NOTICE file for license text.

  • crates/htsengine-sys/src/bindings.rs
    • hts_engine_API
      • Copyright (c) 2001-2014 Nagoya Institute of Technology, Department of Computer Science
      • Copyright (c) 2001-2008 Tokyo Institute of Technology, Interdisciplinary Graduate School of Science and Engineering
  • crates/htsengine-sys/build.rs

License

MIT License

About

Rust binding of hts_engine API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages