voice-changer/recorder/src/index.tsx
2023-02-09 03:12:43 +09:00

98 lines
4.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import * as React from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
import { AppStateProvider } from "./003_provider/AppStateProvider";
import { AppSettingProvider, useAppSetting } from "./003_provider/AppSettingProvider";
import "./100_components/001_css/001_App.css";
const AppStateProviderWrapper = () => {
const { applicationSetting, deviceManagerState } = useAppSetting();
const [firstTach, setFirstTouch] = React.useState<boolean>(false);
if (!applicationSetting || !firstTach) {
const clearSetting = () => {
const result = window.confirm('設定を初期化します。');
if (result) {
applicationSetting.clearSetting()
location.reload()
}
}
return (
<div className="front-container">
<div className="front-title">Corpus Voice Recorder</div>
<div className="front-description">
<p></p>
<p></p>
<p>
使
<a href="https://github.com/w-okada/voice-changer" target="_blank" rel="noopener noreferrer"></a>
</p>
<p className="front-description-strong">使 </p>
<p>
<a href="https://www.buymeacoffee.com/wokad">
<img className="front-description-img" src="./coffee.png"></img>
</a>
</p>
<a></a>
</div>
<div
className="front-start-button front-start-button-color"
onClick={() => {
setFirstTouch(true);
}}
>
Click to start
</div>
<div className="front-note">確認動作環境:Windows 11 + Chrome</div>
<div className="front-description">
<p>ITAコーパスのemotionとrecitationの台本が登録されています</p>
<p>
<a href="https://github.com/isletennos/MMVC_Trainer" target="_blank">
MMVC
</a>
使48000Hz, 16bitの録音設定になっています
</p>
<p>
(24000Hzに変換します)
</p>
</div>
{/* <div className="front-attention">
<p>動作確認のため、少量の利用から始めて、こまめなExportをお願いします。</p>
<p>ブラウザでデータ削除を行うとデータ消えるので注意してください。</p>
</div> */}
<div className="front-disclaimer">使使 </div>
<div className="front-clear-setting" onClick={clearSetting}>
Clear Setting
</div>
</div>
);
} else if (deviceManagerState.audioInputDevices.length === 0) {
return (
<>
<div className="start-button">Loading Devices...</div>
</>
);
} else {
return (
<AppStateProvider>
<App />
</AppStateProvider>
);
}
};
const container = document.getElementById("app")!;
const root = createRoot(container);
root.render(
<AppSettingProvider>
<AppStateProviderWrapper></AppStateProviderWrapper>
</AppSettingProvider>
);