mirror of
https://github.com/storytold/artcraft.git
synced 2026-10-27 03:27:04 +00:00
Better proto pipeline
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
extern crate prost_build;
|
||||
|
||||
fn main() {
|
||||
prost_build::compile_protos(&["protos/audio.proto"],
|
||||
&["protos/"]).unwrap();
|
||||
//prost_build::compile_protos(&["protos/audio.proto"],
|
||||
// &["protos/"]).unwrap();
|
||||
prost_build::Config::new()
|
||||
.out_dir("src/protos/")
|
||||
.compile_protos(&["protos/audio.proto"],
|
||||
&["protos/"])
|
||||
.unwrap();
|
||||
}
|
||||
+8
-2
@@ -1,9 +1,15 @@
|
||||
syntax = "proto3";
|
||||
package voder.audio;
|
||||
package voder_audio;
|
||||
|
||||
message AudioSample {
|
||||
message VocodeAudioRequest {
|
||||
repeated int32 integer_audio = 1;
|
||||
repeated float float_audio = 2;
|
||||
|
||||
bool skip_vocode = 3;
|
||||
}
|
||||
|
||||
message VocodeAudioResponse {
|
||||
repeated int32 integer_audio = 1;
|
||||
repeated float float_audio = 2;
|
||||
}
|
||||
|
||||
|
||||
+7
-1
@@ -13,14 +13,18 @@ extern crate wavy;
|
||||
extern crate world_sys;
|
||||
extern crate zmq;
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/voder.audio.rs"));
|
||||
//include!(concat!(env!("OUT_DIR"), "/voder.audio.rs"));
|
||||
|
||||
pub mod ipc;
|
||||
//pub mod model;
|
||||
pub mod protos;
|
||||
pub mod synthesis;
|
||||
|
||||
use wavy::*;
|
||||
|
||||
use protos::voder_audio::VocodeAudioRequest;
|
||||
use protos::voder_audio::VocodeAudioResponse;
|
||||
|
||||
use byteorder::{ByteOrder, BigEndian, LittleEndian, ReadBytesExt};
|
||||
use cpal::traits::{DeviceTrait, EventLoopTrait, HostTrait};
|
||||
use failure::_core::time::Duration;
|
||||
@@ -128,6 +132,8 @@ fn run_cpal_audio() -> Result<(), failure::Error> {
|
||||
}
|
||||
}
|
||||
|
||||
let mut outgoing = VocodeAudioRequest::default();
|
||||
|
||||
match socket.send(&bytes, 0) {
|
||||
Ok(_) => {
|
||||
//println!("Sent len: {}", bytes.len());
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
pub mod voder_audio;
|
||||
@@ -0,0 +1,16 @@
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct VocodeAudioRequest {
|
||||
#[prost(int32, repeated, tag="1")]
|
||||
pub integer_audio: ::std::vec::Vec<i32>,
|
||||
#[prost(float, repeated, tag="2")]
|
||||
pub float_audio: ::std::vec::Vec<f32>,
|
||||
#[prost(bool, tag="3")]
|
||||
pub skip_vocode: bool,
|
||||
}
|
||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||
pub struct VocodeAudioResponse {
|
||||
#[prost(int32, repeated, tag="1")]
|
||||
pub integer_audio: ::std::vec::Vec<i32>,
|
||||
#[prost(float, repeated, tag="2")]
|
||||
pub float_audio: ::std::vec::Vec<f32>,
|
||||
}
|
||||
Reference in New Issue
Block a user