增加tts初步支持,大文件存储改用lfs
This commit is contained in:
1 parent
512651be68
commit
7df49b37f3
13 files changed
+159
-277
No files matched your search
+31
-13
@@ -32,17 +32,35 @@ import { PDFParse } from "pdf-parse";
|
||||
// },
|
||||
// });
|
||||
|
||||
Deno.test({
|
||||
name: "OpenPGPSigner test",
|
||||
sanitizeOps: false,
|
||||
sanitizeResources: false,
|
||||
async fn() {
|
||||
const { OpenPGPSigner } = await import("./pdf_builder/builder.ts");
|
||||
const signer = new OpenPGPSigner(
|
||||
"./outputs/mobile.pdf",
|
||||
"./private_key.asc",
|
||||
"./outputs/mobile.pdf.sig",
|
||||
);
|
||||
await signer.sign();
|
||||
},
|
||||
// Deno.test({
|
||||
// name: "OpenPGPSigner test",
|
||||
// sanitizeOps: false,
|
||||
// sanitizeResources: false,
|
||||
// async fn() {
|
||||
// const { OpenPGPSigner } = await import("./pdf_builder/builder.ts");
|
||||
// const signer = new OpenPGPSigner(
|
||||
// "./outputs/mobile.pdf",
|
||||
// "./private_key.asc",
|
||||
// "./outputs/mobile.pdf.sig",
|
||||
// );
|
||||
// await signer.sign();
|
||||
// },
|
||||
// });
|
||||
import { writeFileSync } from "node:fs";
|
||||
Deno.test("TTS test", async () => {
|
||||
const { PiperCloudTTS } = await import("./pdf_builder/tts.ts");
|
||||
|
||||
const tts = new PiperCloudTTS("https://piper.cmlmuf.org/");
|
||||
const contents = Deno.readTextFileSync(
|
||||
"./outputs/工农解放报RSF续刊第一期-适合手机阅读.md",
|
||||
);
|
||||
|
||||
await tts.stream_to_file(
|
||||
contents,
|
||||
"zh_CN-xiao_ya-medium",
|
||||
"./outputs/test_audio.wav",
|
||||
1000,
|
||||
);
|
||||
|
||||
console.log("Audio streaming completed to ./outputs/test_audio.wav");
|
||||
});
|
||||
Reference in new issue
Block a user