Skip to content
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

Text-to-speech for iOS #443

Merged
merged 12 commits into from
Nov 23, 2023
Merged

Text-to-speech for iOS #443

merged 12 commits into from
Nov 23, 2023

Conversation

csukuangfj
Copy link
Collaborator

You can find a YouTube video showing how to use it at the following address

https://www.youtube.com/watch?v=MvePdkuMNJk

@csukuangfj csukuangfj merged commit 94ef692 into k2-fsa:master Nov 23, 2023
101 of 109 checks passed
@csukuangfj csukuangfj deleted the ios-tts branch November 23, 2023 13:38
@Web3Kev
Copy link

Web3Kev commented May 22, 2024

hello. Thanks for your work. Has the iOS tts branch been moved ? or is it simply not available anymore ?

@csukuangfj
Copy link
Collaborator Author

@Web3Kev
Copy link

Web3Kev commented May 25, 2024

Thank you for the link and thanks for this awesome repo !
I have successfully built and run iOS-swift/SherpaOnnx but iOS-swiftui/SherpaOnnxTts builds but tts engine always ends up null ...
Also is it possible to use speech recognition with whisper in iOS-swift/SherpaOnnx? or is it a totally different logic?

@csukuangfj
Copy link
Collaborator Author

always ends up null ...

The information you provided is too limited. Would you mind sharing the complete logs? Otherwise, we are not clear what bad things happened.


Also is it possible to use speech recognition with whisper in iOS-swift/SherpaOnnx?

It is 100% possible. Please see our example
https://github.com/k2-fsa/sherpa-onnx/tree/master/ios-swiftui/SherpaOnnx2Pass

@Web3Kev
Copy link

Web3Kev commented May 27, 2024

thanks for the answer. I get this error :
-[NSURL init] called; this results in an NSURL instance with an empty URL string. Please use one of the documented NSURL initialization methods instead (initWithString:, initFileURLWithPath:, etc.). This message shown only once.
/sherpa-onnx/sherpa-onnx/csrc/offline-tts-vits-model-config.cc:Validate:55 '/private/var/containers/Bundle/Application/61C0135C-7096-41AA-9F5A-4E2D204F5A94/SherpaOnnxTts.app/espeak-ng-data/phontab' does not exist. Skipping test
/sherpa-onnx/sherpa-onnx/c-api/c-api.cc:SherpaOnnxCreateOfflineTts:853 Errors in config
TTS object is null
Failed to generate audio

@Web3Kev
Copy link

Web3Kev commented May 27, 2024

I include the .onnx model along with its espeak-ng-data folder (containing phontab) and tokens.txt.
I tried with different models but to no avail.

@csukuangfj
Copy link
Collaborator Author

Please describe in detail how you "include" them.

@csukuangfj
Copy link
Collaborator Author

Please use copy when you include them.

@Web3Kev
Copy link

Web3Kev commented May 27, 2024

I add them to the project, like you describe in the YouTube video.

@Web3Kev
Copy link

Web3Kev commented May 28, 2024

I managed to make it work. The folder was badly imported : create group vs create folder reference.
I had to fix few issues in the swift-ui code to make it work. Now it works like a charm.
I am now trying to export all the files : SherpaOnnx.swift and ViewModel.swift in my flutter Xcode workspace in order to call the methods from flutter.
I have to say that I am not too familiar with Xcode but despite having tried adding onnxruntime.xcframework and sherpa-onnx.xcframework both copied or simply referred, Xcode cannot find the c-api.h methods declared in SherpaOnnx.swift.
I am very sorry for that noob question but am I missing something ? Thanks in advance.

@csukuangfj
Copy link
Collaborator Author

Glad to hear that you finally managed to make it work.

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.

2 participants