diff --git a/src/background.ts b/src/background.ts index 0b6b78a700..9cd5663c9b 100644 --- a/src/background.ts +++ b/src/background.ts @@ -324,12 +324,6 @@ async function uninstallVvppEngine(engineId: EngineId) { } } -// temp dir -const tempDir = path.join(app.getPath("temp"), "VOICEVOX"); -if (!fs.existsSync(tempDir)) { - fs.mkdirSync(tempDir); -} - // 使い方テキストの読み込み const howToUseText = fs.readFileSync( path.join(__static, "howtouse.md"), @@ -563,10 +557,6 @@ ipcMainHandle("GET_APP_INFOS", () => { }; }); -ipcMainHandle("GET_TEMP_DIR", () => { - return tempDir; -}); - ipcMainHandle("GET_HOW_TO_USE_TEXT", () => { return howToUseText; }); @@ -875,10 +865,6 @@ ipcMainHandle("WRITE_FILE", (_, { filePath, buffer }) => { return undefined; }); -ipcMainHandle("JOIN_PATH", (_, { pathArray }) => { - return path.join(...pathArray); -}); - ipcMainHandle("READ_FILE", (_, { filePath }) => { return fs.promises.readFile(filePath); }); diff --git a/src/electron/preload.ts b/src/electron/preload.ts index bb083f5e74..38ed5a9e48 100644 --- a/src/electron/preload.ts +++ b/src/electron/preload.ts @@ -32,8 +32,6 @@ function ipcRendererOn( return ipcRenderer.on(channel, listener); } -let tempDir: string; - const api: Sandbox = { getAppInfos: async () => { return await ipcRendererInvoke("GET_APP_INFOS"); @@ -75,32 +73,6 @@ const api: Sandbox = { return await ipcRendererInvoke("GET_ALT_PORT_INFOS"); }, - saveTempAudioFile: async ({ relativePath, buffer }) => { - if (!tempDir) { - tempDir = await ipcRendererInvoke("GET_TEMP_DIR"); - } - const tempFilePath = await ipcRendererInvoke("JOIN_PATH", { - pathArray: [tempDir, relativePath], - }); - await ipcRendererInvoke("WRITE_FILE", { - filePath: tempFilePath, - buffer: buffer, - }); - }, - - loadTempFile: async () => { - if (!tempDir) { - tempDir = await ipcRendererInvoke("GET_TEMP_DIR"); - } - const tempFilePath = await ipcRendererInvoke("JOIN_PATH", { - pathArray: [tempDir, "hoge.txt"], - }); - const buf = await ipcRendererInvoke("READ_FILE", { - filePath: tempFilePath, - }); - return new TextDecoder().decode(buf); - }, - showAudioSaveDialog: ({ title, defaultPath }) => { return ipcRendererInvoke("SHOW_AUDIO_SAVE_DIALOG", { title, defaultPath }); }, diff --git a/src/type/ipc.ts b/src/type/ipc.ts index 6309a30a52..8e3454a5ad 100644 --- a/src/type/ipc.ts +++ b/src/type/ipc.ts @@ -24,11 +24,6 @@ export type IpcIHData = { return: AppInfos; }; - GET_TEMP_DIR: { - args: []; - return: string; - }; - GET_HOW_TO_USE_TEXT: { args: []; return: string; @@ -297,11 +292,6 @@ export type IpcIHData = { return: void; }; - JOIN_PATH: { - args: [obj: { pathArray: string[] }]; - return: string; - }; - WRITE_FILE: { args: [obj: { filePath: string; buffer: ArrayBuffer }]; return: WriteFileErrorResult | undefined; diff --git a/src/type/preload.ts b/src/type/preload.ts index ccae077555..73ed65e1ca 100644 --- a/src/type/preload.ts +++ b/src/type/preload.ts @@ -144,8 +144,6 @@ export interface Sandbox { getContactText(): Promise; getPrivacyPolicyText(): Promise; getAltPortInfos(): Promise; - saveTempAudioFile(obj: { relativePath: string; buffer: ArrayBuffer }): void; - loadTempFile(): Promise; showAudioSaveDialog(obj: { title: string; defaultPath?: string;