Skip to content

モバイル対応のMAUIサンプルに更新 #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 15, 2025

Conversation

yamachu
Copy link
Owner

@yamachu yamachu commented Mar 15, 2025

fix: #158

voicevox_core 0.16.0-preview.1 がリリースされたことにより、モバイルで本番モデルを使用しやすくなった
CoreSharpで利用可能であることを示したり、モバイル環境での利用方法を示すため、MAUIのサンプルを更新する

@yamachu yamachu force-pushed the maui-sample-renew branch 2 times, most recently from 4f1db11 to 6370e07 Compare March 15, 2025 04:37
@yamachu yamachu requested a review from Copilot March 15, 2025 05:18
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the MAUI sample for better mobile support of VoicevoxCoreSharp by refining native library loading and sample usage.

  • Updated the README with mobile-specific usage instructions.
  • Added iOS and Android implementations for native library resolution.
  • Refactored MainPageViewModel to handle platform-specific paths, directory copying, and model loading.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
examples/MAUI/README.md Updated instructions and requirements for mobile deployment.
src/VoicevoxCoreSharp.MAUI/Platforms/iOS/CoreHelper.cs Added native library resolver logic for iOS.
src/VoicevoxCoreSharp.MAUI/Platforms/Android/CoreHelper.cs Added native library resolver logic for Android.
examples/MAUI/MainPageViewModel.cs Refactored directory retrieval, file copying, and model loading with platform logic.
examples/MAUI/Platforms/iOS/Program.cs Initialized CoreHelper early for proper native library loading on iOS.
examples/MAUI/Platforms/Android/MainApplication.cs Initialized CoreHelper early for proper native library loading on Android.
Comments suppressed due to low confidence (1)

examples/MAUI/MainPageViewModel.cs:273

  • The recursive call to CopyDirectory is not awaited, which might lead to incomplete asynchronous operations; consider awaiting this call.
CopyDirectory(dir, destSubDir);

@yamachu yamachu force-pushed the maui-sample-renew branch from 6370e07 to 5575358 Compare March 15, 2025 08:29
@yamachu yamachu requested a review from Copilot March 15, 2025 08:30
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the MAUI sample to support mobile environments by incorporating voicevox_core 0.16.0-preview.1. Key changes include:

  • Updated README.md with instructions for model downloads and build/run commands for macOS, iOS, and Android.
  • Added platform-specific CoreHelper implementations for iOS and Android to correctly resolve native libraries.
  • Modified MainPageViewModel.cs to use platform-aware paths for loading dependencies and models.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
examples/MAUI/README.md Updated usage instructions and commands for voicevox_core 0.16.0-preview.1
src/VoicevoxCoreSharp.MAUI/Platforms/iOS/CoreHelper.cs Introduced native library resolver for iOS
src/VoicevoxCoreSharp.MAUI/Platforms/Android/CoreHelper.cs Introduced native library resolver for Android
examples/MAUI/Platforms/iOS/Program.cs Added initialization of CoreHelper before native library load
examples/MAUI/MainPageViewModel.cs Updated dependency paths and directory copying for mobile platforms
examples/MAUI/Platforms/Android/MainApplication.cs Added initialization of CoreHelper in the application constructor

@yamachu
Copy link
Owner Author

yamachu commented Mar 15, 2025

/mq

Copy link
Contributor

Copy link
Contributor

Testing: https://github.com/yamachu/VoicevoxCoreSharp/actions/runs/13871186794
You can view state by GitHub CLI below command:

  • gh run view --repo yamachu/VoicevoxCoreSharp 13871186794
  • gh run watch --repo yamachu/VoicevoxCoreSharp 13871186794

If you want to cancel the test, you can cancel it by GitHub CLI below command:

  • gh run cancel --repo yamachu/VoicevoxCoreSharp 13871186794

@actions-commit-pr-dekiru-kun actions-commit-pr-dekiru-kun bot merged commit ce1bd37 into main Mar 15, 2025
14 checks passed
@actions-commit-pr-dekiru-kun actions-commit-pr-dekiru-kun bot deleted the maui-sample-renew branch March 15, 2025 08:34
/// <summary>
/// Initialize VoicevoxCore for loading voicevox_core.framework
/// </summary>
/// <param name="overrideVoicevoxCoreDynamicLibraryPath">if pass `null`, using iOS default framework path.</param>
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あっ、コピペしたままだから、iOSの内容のコメントになってる

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

iOS / Androidサポート
1 participant