diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 363da97..c9cfb77 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,3 +82,8 @@ jobs: releaseDraft: true prerelease: false args: --target aarch64-apple-darwin + + - name: Contribute List + uses: akhilmhdh/contributors-readme-action@v2.3.6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 418ebe0..e69360a 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,8 @@ unzip ./src-tauri/resources/vosk-model-ja-$VOSK_MODEL_VERSION.zip -d ./src-tauri rm ./src-tauri/resources/vosk-model-ja-$VOSK_MODEL_VERSION.zip # whisper -curl -LO https://huggingface.co/datasets/ggerganov/whisper.cpp/resolve/main/ggml-large.bin -mv ggml-large.bin ./src-tauri/resources +curl -LO https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v1.bin +mv ggml-large-v1.bin ./src-tauri/resources/ggml-large.bin ``` ### voskのライブラリ更新 @@ -77,3 +77,8 @@ yarn tauri dev ``` yarn tauri build ``` + +## Contributors + + + diff --git a/package.json b/package.json index 524880f..b5f00b5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "lycoris", "private": true, - "version": "0.9.8", + "version": "0.9.9", "type": "module", "license": "MIT", "engines": { diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 1a94ba3..e25ceb9 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1987,9 +1987,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -2169,7 +2169,7 @@ dependencies = [ "httpdate", "itoa 1.0.10", "pin-project-lite", - "socket2 0.5.6", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -2571,7 +2571,7 @@ dependencies = [ [[package]] name = "lycoris" -version = "0.9.8" +version = "0.9.9" dependencies = [ "chrono", "core-graphics 0.23.1", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index a8b175b..f4b8d30 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lycoris" -version = "0.9.8" +version = "0.9.9" description = "Lycoris is an offline voice memo" authors = ["solaoi"] license = "MIT" diff --git a/src-tauri/migrations/001.sql b/src-tauri/migrations/001.sql index efdde68..ea71bb8 100644 --- a/src-tauri/migrations/001.sql +++ b/src-tauri/migrations/001.sql @@ -42,6 +42,7 @@ INSERT INTO models(model_name, model_type) VALUES("base", "whisper"); INSERT INTO models(model_name, model_type) VALUES("base.en", "whisper"); INSERT INTO models(model_name, model_type) VALUES("large", "whisper"); INSERT INTO models(model_name, model_type) VALUES("large-distil.en", "whisper"); +INSERT INTO models(model_name, model_type) VALUES("large-distil.ja", "whisper"); INSERT INTO models(model_name, model_type) VALUES("medium", "whisper"); INSERT INTO models(model_name, model_type) VALUES("medium.en", "whisper"); INSERT INTO models(model_name, model_type) VALUES("small", "whisper"); diff --git a/src-tauri/src/module/model_type_whisper.rs b/src-tauri/src/module/model_type_whisper.rs index 340a506..7c1d3ad 100644 --- a/src-tauri/src/module/model_type_whisper.rs +++ b/src-tauri/src/module/model_type_whisper.rs @@ -5,6 +5,7 @@ pub enum ModelTypeWhisper { BaseEn, Large, LargeDistilEn, + LargeDistilJa, Medium, MediumEn, Small, @@ -20,6 +21,7 @@ impl ModelTypeWhisper { ModelTypeWhisper::BaseEn => "base.en", ModelTypeWhisper::Large => "large", ModelTypeWhisper::LargeDistilEn => "large-distil.en", + ModelTypeWhisper::LargeDistilJa => "large-distil.ja", ModelTypeWhisper::Medium => "medium", ModelTypeWhisper::MediumEn => "medium.en", ModelTypeWhisper::Small => "small", @@ -39,6 +41,7 @@ impl FromStr for ModelTypeWhisper { "base.en" => Ok(ModelTypeWhisper::BaseEn), "large" => Ok(ModelTypeWhisper::Large), "large-distil.en" => Ok(ModelTypeWhisper::LargeDistilEn), + "large-distil.ja" => Ok(ModelTypeWhisper::LargeDistilJa), "medium" => Ok(ModelTypeWhisper::Medium), "medium.en" => Ok(ModelTypeWhisper::MediumEn), "small" => Ok(ModelTypeWhisper::Small), diff --git a/src-tauri/src/module/record.rs b/src-tauri/src/module/record.rs index b0f434d..d690ccb 100644 --- a/src-tauri/src/module/record.rs +++ b/src-tauri/src/module/record.rs @@ -131,6 +131,10 @@ impl Record { .expect("Could not build stream"); stream.play().expect("Could not play stream"); + + let app_handle = self.app_handle.clone(); + app_handle.clone().emit_all("readyToRecognize", "").unwrap(); + let (stop_writer_tx, stop_writer_rx) = sync_channel(1); let is_converting = Arc::new(Mutex::new(false)); let (stop_convert_tx, stop_convert_rx) = unbounded(); diff --git a/src-tauri/src/module/record_desktop.rs b/src-tauri/src/module/record_desktop.rs index 094dbb3..f4b61a9 100644 --- a/src-tauri/src/module/record_desktop.rs +++ b/src-tauri/src/module/record_desktop.rs @@ -160,6 +160,9 @@ impl RecordDesktop { ); stream.start_capture().ok(); + let app_handle = self.app_handle.clone(); + app_handle.clone().emit_all("readyToRecognize", "").unwrap(); + let (stop_writer_tx, stop_writer_rx) = sync_channel(1); let is_converting = Arc::new(Mutex::new(false)); let (stop_convert_tx, stop_convert_rx) = unbounded(); diff --git a/src-tauri/src/module/transcriber.rs b/src-tauri/src/module/transcriber.rs index 8e5e7c1..c0c11e1 100644 --- a/src-tauri/src/module/transcriber.rs +++ b/src-tauri/src/module/transcriber.rs @@ -12,8 +12,10 @@ impl Transcriber { model_type = "small"; } else if transcription_accuracy.starts_with("medium") { model_type = "medium" - } else if transcription_accuracy.starts_with("large-distil.en"){ + } else if transcription_accuracy.starts_with("large-distil.en") { model_type = "large-distil.en" + } else if transcription_accuracy.starts_with("large-distil.ja") { + model_type = "large-distil.ja" } else if transcription_accuracy.starts_with("large") { model_type = "large" } @@ -24,7 +26,8 @@ impl Transcriber { .to_string_lossy() .to_string(); - return WhisperContext::new_with_params(&model_path, WhisperContextParameters::default()).expect("failed to load whisper model"); + return WhisperContext::new_with_params(&model_path, WhisperContextParameters::default()) + .expect("failed to load whisper model"); } pub fn build_params( diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 48ff038..5310c43 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "Lycoris", - "version": "0.9.8" + "version": "0.9.9" }, "tauri": { "allowlist": { diff --git a/src/components/molecules/RecordPreparingButton.tsx b/src/components/molecules/RecordPreparingButton.tsx new file mode 100644 index 0000000..a9720c2 --- /dev/null +++ b/src/components/molecules/RecordPreparingButton.tsx @@ -0,0 +1,10 @@ +const RecordPreparingButton = (): JSX.Element => { + return ( + + ) +} + +export { RecordPreparingButton } \ No newline at end of file diff --git a/src/components/molecules/TranscriptionAccuracy.tsx b/src/components/molecules/TranscriptionAccuracy.tsx index 968726e..e42dacc 100644 --- a/src/components/molecules/TranscriptionAccuracy.tsx +++ b/src/components/molecules/TranscriptionAccuracy.tsx @@ -43,6 +43,12 @@ const TranscriptionAccuracy = (): JSX.Element => { return "文字起こし:高"; case "large-distil.en": return "文字起こし:英"; + case "large-distil.ja": + return "文字起こし:日"; + case "online-transcript": + return "文字起こし:オンライン"; + case "online-chat": + return "AI:オンライン"; case "small-translate-to-en": return "翻訳(英):低"; case "medium-translate-to-en": @@ -102,6 +108,13 @@ const TranscriptionAccuracy = (): JSX.Element => { return a } } + if (c === "large-distil.ja") { + if (speakerLanguage?.startsWith("ja") || speakerLanguage?.startsWith("small-ja")) { + return [...a, c] + } else { + return a + } + } return [...a, c, `${c}-translate-to-en`] }, []).map((model, i) => (
  • diff --git a/src/components/organisms/NoteMain.tsx b/src/components/organisms/NoteMain.tsx index 796391d..4e415e9 100644 --- a/src/components/organisms/NoteMain.tsx +++ b/src/components/organisms/NoteMain.tsx @@ -18,6 +18,7 @@ import { TraceStartButton } from '../molecules/TraceStartButton' import { TraceStopButton } from '../molecules/TraceStopButton' import { tracingState } from '../../store/atoms/tracingState' import { tracingNoteState } from '../../store/atoms/tracingNoteState' +import { RecordPreparingButton } from '../molecules/RecordPreparingButton' const NoteMain = (): JSX.Element => { const transcriptionAccuracy = useRecoilValue(transcriptionAccuracyState) @@ -42,6 +43,7 @@ const NoteMain = (): JSX.Element => { setShowGotoBottom(true); } }, []); + const [isReadyToRecognize, setIsReadyToRecognize] = useState(false); useEffect(() => { const scrollContainer = scrollContainerRef.current; if (scrollContainer) { @@ -121,6 +123,19 @@ const NoteMain = (): JSX.Element => { } }, [recordingNote, isTracing]) + useEffect(() => { + if (isRecording) { + const unlistenReadyToRecognize = listen('readyToRecognize', () => { + setIsReadyToRecognize(true); + }); + return () => { + unlistenReadyToRecognize.then(f => f()); + } + } else { + setIsReadyToRecognize(false); + } + }, [isRecording]) + return (<>

    { }

    - {(isRecording && recordingNote === selectedNote?.note_id) ? : } + {(isRecording && recordingNote === selectedNote?.note_id) ? isReadyToRecognize ? : : }
    diff --git a/src/components/organisms/SettingsMain.tsx b/src/components/organisms/SettingsMain.tsx index 568ec82..5fb68f7 100644 --- a/src/components/organisms/SettingsMain.tsx +++ b/src/components/organisms/SettingsMain.tsx @@ -330,6 +330,13 @@ const SettingsMain = (): JSX.Element => {
    +
    +
    +

    言語パック(日本語:速度優先)

    + +
    + +