mirror of
https://github.com/neodyland/sbv2-api.git
synced 2026-01-03 13:02:57 +00:00
Compare commits
1 Commits
commit-180
...
v0.2.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
159f58026d |
4
.github/dependabot.yml
vendored
4
.github/dependabot.yml
vendored
@@ -9,7 +9,3 @@ updates:
|
|||||||
directory: "/" # Location of package manifests
|
directory: "/" # Location of package manifests
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "weekly"
|
||||||
- package-ecosystem: "npm" # See documentation for possible values
|
|
||||||
directory: "/" # Location of package manifests
|
|
||||||
schedule:
|
|
||||||
interval: "weekly"
|
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,10 +1,10 @@
|
|||||||
target/
|
target/
|
||||||
models/
|
models/
|
||||||
!models/.gitkeep
|
!models/.gitkeep
|
||||||
venv/
|
.venv/
|
||||||
.env
|
.env
|
||||||
*.wav
|
*.wav
|
||||||
node_modules/
|
node_modules/
|
||||||
dist/
|
dist/
|
||||||
*.csv
|
*.csv
|
||||||
*.bin
|
*.bin
|
||||||
|
|||||||
1406
Cargo.lock
generated
1406
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ resolver = "3"
|
|||||||
members = ["./crates/sbv2_api", "./crates/sbv2_core", "./crates/sbv2_bindings", "./crates/sbv2_wasm"]
|
members = ["./crates/sbv2_api", "./crates/sbv2_core", "./crates/sbv2_bindings", "./crates/sbv2_wasm"]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.2.0"
|
version = "0.2.0-alpha7"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Style-Bert-VITSの推論ライブラリ"
|
description = "Style-Bert-VITSの推論ライブラリ"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
@@ -12,10 +12,10 @@ repository = "https://github.com/neodyland/sbv2-api"
|
|||||||
documentation = "https://docs.rs/sbv2_core"
|
documentation = "https://docs.rs/sbv2_core"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
anyhow = "1.0.100"
|
anyhow = "1.0.96"
|
||||||
dotenvy = "0.15.7"
|
dotenvy = "0.15.7"
|
||||||
env_logger = "0.11.6"
|
env_logger = "0.11.6"
|
||||||
ndarray = "0.17.1"
|
ndarray = "0.16.1"
|
||||||
once_cell = "1.20.3"
|
once_cell = "1.20.3"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ license.workspace = true
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
axum = "0.8.8"
|
axum = "0.8.0"
|
||||||
dotenvy.workspace = true
|
dotenvy.workspace = true
|
||||||
env_logger.workspace = true
|
env_logger.workspace = true
|
||||||
log = "0.4.29"
|
log = "0.4.22"
|
||||||
sbv2_core = { version = "0.2.0-alpha6", path = "../sbv2_core", features = ["aivmx"] }
|
sbv2_core = { version = "0.2.0-alpha6", path = "../sbv2_core", features = ["aivmx"] }
|
||||||
serde = { version = "1.0.228", features = ["derive"] }
|
serde = { version = "1.0.210", features = ["derive"] }
|
||||||
tokio = { version = "1.48.0", features = ["full"] }
|
tokio = { version = "1.46.1", features = ["full"] }
|
||||||
utoipa = { version = "5.4.0", features = ["axum_extras"] }
|
utoipa = { version = "5.4.0", features = ["axum_extras"] }
|
||||||
utoipa-scalar = { version = "0.3.0", features = ["axum"] }
|
utoipa-scalar = { version = "0.3.0", features = ["axum"] }
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ crate-type = ["cdylib"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow.workspace = true
|
anyhow.workspace = true
|
||||||
ndarray.workspace = true
|
ndarray.workspace = true
|
||||||
pyo3 = { version = "0.27.2", features = ["anyhow"] }
|
pyo3 = { version = "0.25.1", features = ["anyhow"] }
|
||||||
sbv2_core = { path = "../sbv2_core", features = ["std"], default-features = false }
|
sbv2_core = { path = "../sbv2_core", features = ["std"], default-features = false }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|||||||
@@ -14,18 +14,18 @@ base64 = { version = "0.22.1", optional = true }
|
|||||||
dotenvy.workspace = true
|
dotenvy.workspace = true
|
||||||
env_logger.workspace = true
|
env_logger.workspace = true
|
||||||
hound = "3.5.1"
|
hound = "3.5.1"
|
||||||
jpreprocess = { version = "0.13.2", features = ["naist-jdic"] }
|
jpreprocess = { version = "0.12.0", features = ["naist-jdic"] }
|
||||||
ndarray.workspace = true
|
ndarray.workspace = true
|
||||||
npyz = { version = "0.8.4", optional = true }
|
npyz = { version = "0.8.4", optional = true }
|
||||||
num_cpus = "1.17.0"
|
num_cpus = "1.16.0"
|
||||||
once_cell.workspace = true
|
once_cell.workspace = true
|
||||||
ort = { git = "https://github.com/pykeio/ort.git", version = "2.0.0-rc.9", optional = true }
|
ort = { git = "https://github.com/pykeio/ort.git", version = "2.0.0-rc.10", optional = true }
|
||||||
regex = "1.12.2"
|
regex = "1.10.6"
|
||||||
serde = { version = "1.0.228", features = ["derive"] }
|
serde = { version = "1.0.210", features = ["derive"] }
|
||||||
serde_json = "1.0.145"
|
serde_json = "1.0.128"
|
||||||
tar = "0.4.41"
|
tar = "0.4.41"
|
||||||
thiserror = "2.0.17"
|
thiserror = "2.0.11"
|
||||||
tokenizers = { version = "0.22.2", default-features = false }
|
tokenizers = { version = "0.21.2", default-features = false }
|
||||||
zstd = "0.13.2"
|
zstd = "0.13.2"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
@@ -44,4 +44,4 @@ base64 = ["dep:base64"]
|
|||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
dirs = "6.0.0"
|
dirs = "6.0.0"
|
||||||
ureq = "3.1.4"
|
ureq = "3.0.12"
|
||||||
|
|||||||
@@ -1,175 +1,3 @@
|
|||||||
/*
|
|
||||||
このファイルのコードは
|
|
||||||
https://github.com/litagin02/Style-Bert-VITS2/blob/master/style_bert_vits2/nlp/japanese/g2p.py
|
|
||||||
を参考にRustに書き換えています。
|
|
||||||
|
|
||||||
以下はライセンスです。
|
|
||||||
GNU LESSER GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
|
|
||||||
This version of the GNU Lesser General Public License incorporates
|
|
||||||
the terms and conditions of version 3 of the GNU General Public
|
|
||||||
License, supplemented by the additional permissions listed below.
|
|
||||||
|
|
||||||
0. Additional Definitions.
|
|
||||||
|
|
||||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
|
||||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
|
||||||
General Public License.
|
|
||||||
|
|
||||||
"The Library" refers to a covered work governed by this License,
|
|
||||||
other than an Application or a Combined Work as defined below.
|
|
||||||
|
|
||||||
An "Application" is any work that makes use of an interface provided
|
|
||||||
by the Library, but which is not otherwise based on the Library.
|
|
||||||
Defining a subclass of a class defined by the Library is deemed a mode
|
|
||||||
of using an interface provided by the Library.
|
|
||||||
|
|
||||||
A "Combined Work" is a work produced by combining or linking an
|
|
||||||
Application with the Library. The particular version of the Library
|
|
||||||
with which the Combined Work was made is also called the "Linked
|
|
||||||
Version".
|
|
||||||
|
|
||||||
The "Minimal Corresponding Source" for a Combined Work means the
|
|
||||||
Corresponding Source for the Combined Work, excluding any source code
|
|
||||||
for portions of the Combined Work that, considered in isolation, are
|
|
||||||
based on the Application, and not on the Linked Version.
|
|
||||||
|
|
||||||
The "Corresponding Application Code" for a Combined Work means the
|
|
||||||
object code and/or source code for the Application, including any data
|
|
||||||
and utility programs needed for reproducing the Combined Work from the
|
|
||||||
Application, but excluding the System Libraries of the Combined Work.
|
|
||||||
|
|
||||||
1. Exception to Section 3 of the GNU GPL.
|
|
||||||
|
|
||||||
You may convey a covered work under sections 3 and 4 of this License
|
|
||||||
without being bound by section 3 of the GNU GPL.
|
|
||||||
|
|
||||||
2. Conveying Modified Versions.
|
|
||||||
|
|
||||||
If you modify a copy of the Library, and, in your modifications, a
|
|
||||||
facility refers to a function or data to be supplied by an Application
|
|
||||||
that uses the facility (other than as an argument passed when the
|
|
||||||
facility is invoked), then you may convey a copy of the modified
|
|
||||||
version:
|
|
||||||
|
|
||||||
a) under this License, provided that you make a good faith effort to
|
|
||||||
ensure that, in the event an Application does not supply the
|
|
||||||
function or data, the facility still operates, and performs
|
|
||||||
whatever part of its purpose remains meaningful, or
|
|
||||||
|
|
||||||
b) under the GNU GPL, with none of the additional permissions of
|
|
||||||
this License applicable to that copy.
|
|
||||||
|
|
||||||
3. Object Code Incorporating Material from Library Header Files.
|
|
||||||
|
|
||||||
The object code form of an Application may incorporate material from
|
|
||||||
a header file that is part of the Library. You may convey such object
|
|
||||||
code under terms of your choice, provided that, if the incorporated
|
|
||||||
material is not limited to numerical parameters, data structure
|
|
||||||
layouts and accessors, or small macros, inline functions and templates
|
|
||||||
(ten or fewer lines in length), you do both of the following:
|
|
||||||
|
|
||||||
a) Give prominent notice with each copy of the object code that the
|
|
||||||
Library is used in it and that the Library and its use are
|
|
||||||
covered by this License.
|
|
||||||
|
|
||||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
|
||||||
document.
|
|
||||||
|
|
||||||
4. Combined Works.
|
|
||||||
|
|
||||||
You may convey a Combined Work under terms of your choice that,
|
|
||||||
taken together, effectively do not restrict modification of the
|
|
||||||
portions of the Library contained in the Combined Work and reverse
|
|
||||||
engineering for debugging such modifications, if you also do each of
|
|
||||||
the following:
|
|
||||||
|
|
||||||
a) Give prominent notice with each copy of the Combined Work that
|
|
||||||
the Library is used in it and that the Library and its use are
|
|
||||||
covered by this License.
|
|
||||||
|
|
||||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
|
||||||
document.
|
|
||||||
|
|
||||||
c) For a Combined Work that displays copyright notices during
|
|
||||||
execution, include the copyright notice for the Library among
|
|
||||||
these notices, as well as a reference directing the user to the
|
|
||||||
copies of the GNU GPL and this license document.
|
|
||||||
|
|
||||||
d) Do one of the following:
|
|
||||||
|
|
||||||
0) Convey the Minimal Corresponding Source under the terms of this
|
|
||||||
License, and the Corresponding Application Code in a form
|
|
||||||
suitable for, and under terms that permit, the user to
|
|
||||||
recombine or relink the Application with a modified version of
|
|
||||||
the Linked Version to produce a modified Combined Work, in the
|
|
||||||
manner specified by section 6 of the GNU GPL for conveying
|
|
||||||
Corresponding Source.
|
|
||||||
|
|
||||||
1) Use a suitable shared library mechanism for linking with the
|
|
||||||
Library. A suitable mechanism is one that (a) uses at run time
|
|
||||||
a copy of the Library already present on the user's computer
|
|
||||||
system, and (b) will operate properly with a modified version
|
|
||||||
of the Library that is interface-compatible with the Linked
|
|
||||||
Version.
|
|
||||||
|
|
||||||
e) Provide Installation Information, but only if you would otherwise
|
|
||||||
be required to provide such information under section 6 of the
|
|
||||||
GNU GPL, and only to the extent that such information is
|
|
||||||
necessary to install and execute a modified version of the
|
|
||||||
Combined Work produced by recombining or relinking the
|
|
||||||
Application with a modified version of the Linked Version. (If
|
|
||||||
you use option 4d0, the Installation Information must accompany
|
|
||||||
the Minimal Corresponding Source and Corresponding Application
|
|
||||||
Code. If you use option 4d1, you must provide the Installation
|
|
||||||
Information in the manner specified by section 6 of the GNU GPL
|
|
||||||
for conveying Corresponding Source.)
|
|
||||||
|
|
||||||
5. Combined Libraries.
|
|
||||||
|
|
||||||
You may place library facilities that are a work based on the
|
|
||||||
Library side by side in a single library together with other library
|
|
||||||
facilities that are not Applications and are not covered by this
|
|
||||||
License, and convey such a combined library under terms of your
|
|
||||||
choice, if you do both of the following:
|
|
||||||
|
|
||||||
a) Accompany the combined library with a copy of the same work based
|
|
||||||
on the Library, uncombined with any other library facilities,
|
|
||||||
conveyed under the terms of this License.
|
|
||||||
|
|
||||||
b) Give prominent notice with the combined library that part of it
|
|
||||||
is a work based on the Library, and explaining where to find the
|
|
||||||
accompanying uncombined form of the same work.
|
|
||||||
|
|
||||||
6. Revised Versions of the GNU Lesser General Public License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions
|
|
||||||
of the GNU Lesser General Public License from time to time. Such new
|
|
||||||
versions will be similar in spirit to the present version, but may
|
|
||||||
differ in detail to address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Library as you received it specifies that a certain numbered version
|
|
||||||
of the GNU Lesser General Public License "or any later version"
|
|
||||||
applies to it, you have the option of following the terms and
|
|
||||||
conditions either of that published version or of any later version
|
|
||||||
published by the Free Software Foundation. If the Library as you
|
|
||||||
received it does not specify a version number of the GNU Lesser
|
|
||||||
General Public License, you may choose any version of the GNU Lesser
|
|
||||||
General Public License ever published by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Library as you received it specifies that a proxy can decide
|
|
||||||
whether future versions of the GNU Lesser General Public License shall
|
|
||||||
apply, that proxy's public statement of acceptance of any version is
|
|
||||||
permanent authorization for you to choose that version for the
|
|
||||||
Library.
|
|
||||||
*/
|
|
||||||
use crate::error::{Error, Result};
|
use crate::error::{Error, Result};
|
||||||
use crate::mora::{CONSONANTS, MORA_KATA_TO_MORA_PHONEMES, MORA_PHONEMES_TO_MORA_KATA, VOWELS};
|
use crate::mora::{CONSONANTS, MORA_KATA_TO_MORA_PHONEMES, MORA_PHONEMES_TO_MORA_KATA, VOWELS};
|
||||||
use crate::norm::{replace_punctuation, PUNCTUATIONS};
|
use crate::norm::{replace_punctuation, PUNCTUATIONS};
|
||||||
@@ -299,20 +127,20 @@ impl JTalkProcess {
|
|||||||
Ok(phone_tone_list)
|
Ok(phone_tone_list)
|
||||||
} else if tone_values.len() == 2 {
|
} else if tone_values.len() == 2 {
|
||||||
if tone_values == hash_set![0, 1] {
|
if tone_values == hash_set![0, 1] {
|
||||||
Ok(phone_tone_list)
|
return Ok(phone_tone_list);
|
||||||
} else if tone_values == hash_set![-1, 0] {
|
} else if tone_values == hash_set![-1, 0] {
|
||||||
Ok(phone_tone_list
|
return Ok(phone_tone_list
|
||||||
.iter()
|
.iter()
|
||||||
.map(|x| {
|
.map(|x| {
|
||||||
let new_tone = if x.1 == -1 { 0 } else { 1 };
|
let new_tone = if x.1 == -1 { 0 } else { 1 };
|
||||||
(x.0.clone(), new_tone)
|
(x.0.clone(), new_tone)
|
||||||
})
|
})
|
||||||
.collect())
|
.collect());
|
||||||
} else {
|
} else {
|
||||||
Err(Error::ValueError("Invalid tone values 0".to_string()))
|
return Err(Error::ValueError("Invalid tone values 0".to_string()));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Err(Error::ValueError("Invalid tone values 1".to_string()))
|
return Err(Error::ValueError("Invalid tone values 1".to_string()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ impl TTSModelHolder {
|
|||||||
}
|
}
|
||||||
let model = model::load_model(&aivmx_bytes, false)?;
|
let model = model::load_model(&aivmx_bytes, false)?;
|
||||||
let metadata = model.metadata()?;
|
let metadata = model.metadata()?;
|
||||||
if let Some(aivm_style_vectors) = metadata.custom("aivm_style_vectors") {
|
if let Some(aivm_style_vectors) = metadata.custom("aivm_style_vectors")? {
|
||||||
let aivm_style_vectors = BASE64_STANDARD.decode(aivm_style_vectors)?;
|
let aivm_style_vectors = BASE64_STANDARD.decode(aivm_style_vectors)?;
|
||||||
let style_vectors = Cursor::new(&aivm_style_vectors);
|
let style_vectors = Cursor::new(&aivm_style_vectors);
|
||||||
let reader = npyz::NpyFile::new(style_vectors)?;
|
let reader = npyz::NpyFile::new(style_vectors)?;
|
||||||
@@ -240,43 +240,39 @@ impl TTSModelHolder {
|
|||||||
}
|
}
|
||||||
fn find_and_load_model<I: Into<TTSIdent>>(&mut self, ident: I) -> Result<bool> {
|
fn find_and_load_model<I: Into<TTSIdent>>(&mut self, ident: I) -> Result<bool> {
|
||||||
let ident = ident.into();
|
let ident = ident.into();
|
||||||
// Locate target model entry
|
let (bytes, style_vectors) = {
|
||||||
let target_index = self
|
let model = self
|
||||||
.models
|
.models
|
||||||
.iter()
|
.iter()
|
||||||
.position(|m| m.ident == ident)
|
.find(|m| m.ident == ident)
|
||||||
.ok_or(Error::ModelNotFoundError(ident.to_string()))?;
|
.ok_or(Error::ModelNotFoundError(ident.to_string()))?;
|
||||||
|
if model.vits2.is_some() {
|
||||||
// Already loaded
|
return Ok(true);
|
||||||
if self.models[target_index].vits2.is_some() {
|
}
|
||||||
return Ok(true);
|
(model.bytes.clone().unwrap(), model.style_vectors.clone())
|
||||||
}
|
};
|
||||||
|
self.unload(ident.clone());
|
||||||
// Get bytes to build a Session
|
let s = model::load_model(&bytes, false)?;
|
||||||
let bytes = self.models[target_index]
|
|
||||||
.bytes
|
|
||||||
.clone()
|
|
||||||
.ok_or(Error::ModelNotFoundError(ident.to_string()))?;
|
|
||||||
|
|
||||||
// Enforce max loaded models by evicting a different loaded model's session, not removing the entry
|
|
||||||
if let Some(max) = self.max_loaded_models {
|
if let Some(max) = self.max_loaded_models {
|
||||||
let loaded_count = self.models.iter().filter(|m| m.vits2.is_some()).count();
|
if self.models.iter().filter(|x| x.vits2.is_some()).count() >= max {
|
||||||
if loaded_count >= max {
|
self.unload(self.models.first().unwrap().ident.clone());
|
||||||
if let Some(evict_index) = self
|
|
||||||
.models
|
|
||||||
.iter()
|
|
||||||
.position(|m| m.vits2.is_some() && m.ident != ident)
|
|
||||||
{
|
|
||||||
// Drop only the session to free memory; keep bytes/style for future reload
|
|
||||||
self.models[evict_index].vits2 = None;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
self.models.push(TTSModel {
|
||||||
// Build and set session in-place for the target model
|
bytes: Some(bytes.to_vec()),
|
||||||
let s = model::load_model(&bytes, false)?;
|
vits2: Some(s),
|
||||||
self.models[target_index].vits2 = Some(s);
|
style_vectors,
|
||||||
Ok(true)
|
ident: ident.clone(),
|
||||||
|
});
|
||||||
|
let model = self
|
||||||
|
.models
|
||||||
|
.iter()
|
||||||
|
.find(|m| m.ident == ident)
|
||||||
|
.ok_or(Error::ModelNotFoundError(ident.to_string()))?;
|
||||||
|
if model.vits2.is_some() {
|
||||||
|
return Ok(true);
|
||||||
|
}
|
||||||
|
Err(Error::ModelNotFoundError(ident.to_string()))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get style vector by style id and weight
|
/// Get style vector by style id and weight
|
||||||
|
|||||||
@@ -173,15 +173,8 @@ pub fn parse_text_blocking(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn array_to_vec(audio_array: Array3<f32>) -> Result<Vec<u8>> {
|
pub fn array_to_vec(audio_array: Array3<f32>) -> Result<Vec<u8>> {
|
||||||
// If SBV2_FORCE_STEREO is set ("1"/"true"), duplicate mono to stereo
|
|
||||||
let force_stereo = std::env::var("SBV2_FORCE_STEREO")
|
|
||||||
.ok()
|
|
||||||
.map(|v| matches!(v.as_str(), "1" | "true" | "TRUE" | "True"))
|
|
||||||
.unwrap_or(false);
|
|
||||||
|
|
||||||
let channels: u16 = if force_stereo { 2 } else { 1 };
|
|
||||||
let spec = WavSpec {
|
let spec = WavSpec {
|
||||||
channels,
|
channels: 1,
|
||||||
sample_rate: 44100,
|
sample_rate: 44100,
|
||||||
bits_per_sample: 32,
|
bits_per_sample: 32,
|
||||||
sample_format: SampleFormat::Float,
|
sample_format: SampleFormat::Float,
|
||||||
@@ -190,16 +183,8 @@ pub fn array_to_vec(audio_array: Array3<f32>) -> Result<Vec<u8>> {
|
|||||||
let mut writer = WavWriter::new(&mut cursor, spec)?;
|
let mut writer = WavWriter::new(&mut cursor, spec)?;
|
||||||
for i in 0..audio_array.shape()[0] {
|
for i in 0..audio_array.shape()[0] {
|
||||||
let output = audio_array.slice(s![i, 0, ..]).to_vec();
|
let output = audio_array.slice(s![i, 0, ..]).to_vec();
|
||||||
if force_stereo {
|
for sample in output {
|
||||||
for sample in output {
|
writer.write_sample(sample)?;
|
||||||
// Write to Left and Right channels
|
|
||||||
writer.write_sample(sample)?;
|
|
||||||
writer.write_sample(sample)?;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for sample in output {
|
|
||||||
writer.write_sample(sample)?;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
writer.finalize()?;
|
writer.finalize()?;
|
||||||
|
|||||||
@@ -17,4 +17,4 @@ sbv2_core = { path = "../sbv2_core", default-features = false, features = ["no_s
|
|||||||
once_cell.workspace = true
|
once_cell.workspace = true
|
||||||
js-sys = "0.3.70"
|
js-sys = "0.3.70"
|
||||||
ndarray.workspace = true
|
ndarray.workspace = true
|
||||||
wasm-bindgen-futures = "0.4.56"
|
wasm-bindgen-futures = "0.4.43"
|
||||||
|
|||||||
Reference in New Issue
Block a user