-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into change-liberate-voicevox-core
- Loading branch information
Showing
27 changed files
with
373 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,22 +51,22 @@ jobs: | |
poetry install --with test | ||
- name: mkdir public | ||
run: mkdir -p public/apis/c_api | ||
- name: cp docs/apis/index.html | ||
run: cp docs/apis/index.html public/apis/ | ||
- name: cp docs/ghpages/apis/index.html | ||
run: cp docs/ghpages/apis/index.html public/apis/ | ||
- name: Generate rustdoc | ||
run: | | ||
cargo +${{ steps.docsrs-rust-version.outputs.rust-toolchain }} docs-rs -p voicevox_core | ||
mv target/x86_64-unknown-linux-gnu/doc public/apis/rust_api | ||
- name: cp crates/voicevox_core_c_api/include/voicevox_core.h | ||
run: cp crates/voicevox_core_c_api/include/voicevox_core.h docs/apis/c_api/doxygen/ | ||
run: cp crates/voicevox_core_c_api/include/voicevox_core.h docs/ghpages/apis/c_api/doxygen/ | ||
- name: Generate doxygen document | ||
uses: mattnotmitt/[email protected] | ||
with: | ||
working-directory: "docs/apis/c_api/doxygen" | ||
working-directory: "docs/ghpages/apis/c_api/doxygen" | ||
- name: Build voicevox_core_python_api | ||
run: maturin develop --manifest-path ./crates/voicevox_core_python_api/Cargo.toml --locked | ||
- name: Generate Sphinx document | ||
run: sphinx-build docs/apis/python_api public/apis/python_api | ||
run: sphinx-build docs/ghpages/apis/python_api public/apis/python_api | ||
- name: Generate Javadoc | ||
run: | | ||
(cd crates/voicevox_core_java_api && ./gradlew javadoc) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "docs/apis/c_api/doxygen/doxygen-awesome-css"] | ||
path = docs/apis/c_api/doxygen/doxygen-awesome-css | ||
[submodule "docs/ghpages/apis/c_api/doxygen/doxygen-awesome-css"] | ||
path = docs/ghpages/apis/c_api/doxygen/doxygen-awesome-css | ||
url = https://github.com/jothepro/doxygen-awesome-css.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use std::io::{Cursor, Write as _}; | ||
|
||
/// 16bit PCMにヘッダを付加しWAVフォーマットのバイナリを生成する。 | ||
pub fn wav_from_s16le(pcm: &[u8], sampling_rate: u32, is_stereo: bool) -> Vec<u8> { | ||
let num_channels: u16 = if is_stereo { 2 } else { 1 }; | ||
let bit_depth: u16 = 16; | ||
let block_size: u16 = bit_depth * num_channels / 8; | ||
|
||
let bytes_size = pcm.len() as u32; | ||
let wave_size = bytes_size + 44; | ||
|
||
let buf: Vec<u8> = Vec::with_capacity(wave_size as usize); | ||
let mut cur = Cursor::new(buf); | ||
|
||
cur.write_all("RIFF".as_bytes()).unwrap(); | ||
cur.write_all(&(wave_size - 8).to_le_bytes()).unwrap(); | ||
cur.write_all("WAVEfmt ".as_bytes()).unwrap(); | ||
cur.write_all(&16_u32.to_le_bytes()).unwrap(); // fmt header length | ||
cur.write_all(&1_u16.to_le_bytes()).unwrap(); // linear PCM | ||
cur.write_all(&num_channels.to_le_bytes()).unwrap(); | ||
cur.write_all(&sampling_rate.to_le_bytes()).unwrap(); | ||
|
||
let block_rate = sampling_rate * block_size as u32; | ||
|
||
cur.write_all(&block_rate.to_le_bytes()).unwrap(); | ||
cur.write_all(&block_size.to_le_bytes()).unwrap(); | ||
cur.write_all(&bit_depth.to_le_bytes()).unwrap(); | ||
cur.write_all("data".as_bytes()).unwrap(); | ||
cur.write_all(&bytes_size.to_le_bytes()).unwrap(); | ||
cur.write_all(pcm).unwrap(); | ||
cur.into_inner() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.