feat(enhancement): add CAMB AI audio enhancement for dictionary lookups#504
Open
neilruaro-camb wants to merge 1 commit intoarianneorpilla:mainfrom
Open
feat(enhancement): add CAMB AI audio enhancement for dictionary lookups#504neilruaro-camb wants to merge 1 commit intoarianneorpilla:mainfrom
neilruaro-camb wants to merge 1 commit intoarianneorpilla:mainfrom
Conversation
Adds a third audio enhancement alongside Forvo and JapanesePod101 so that words without community recordings can still be pronounced. Uses the same AudioEnhancement abstract class pattern, registered in the default mapping for both Japanese and non Japanese profiles. For Japanese, the kana reading is preferred over kanji as the TTS input so pronunciation is correct. Generated mp3s are cached in the application support directory keyed by language, voice id, and a hash of the text, so repeat lookups are instant. No new Dart dependency: uses the package:http already bundled with the other enhancements. Configuration: flutter build ios --dart-define=CAMB_API_KEY=<key> # or flutter run --dart-define=CAMB_API_KEY=<key> The build time define keeps this first iteration minimal. A follow up can move the key to a Hive backed settings field next to the other enhancement settings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi from Camb AI
We are Camb AI, the localization engine of choice for brands like the Premier League, NBA, NASCAR, and the Australian Open. We work with rightsholders and platforms who need high quality, low latency text to speech and dubbing in dozens of languages.
We'd love to be added as an audio enhancement option in jidoujisho, alongside Forvo and JapanesePod101. The clean
AudioEnhancementplugin pattern made this very easy to slot in. We hope this complements the existing community recordings, especially for rare words and for languages where Forvo coverage is thin.Happy to iterate on naming, defaults, docs, or anything else you'd prefer. Thanks for maintaining jidoujisho.
What this PR does
yuuna/lib/src/creator/enhancements/cambai_audio_enhancement.dartextends the existingAudioEnhancementabstract class. Same shape asForvoAudioEnhancementandJapanesePod101AudioEnhancement.package:httpthat the other enhancements already pull in.app_model.dart'spopulateEnhancements()and added to the default enhancement slot maps inanki_mapping.dart(both Japanese and non Japanese profiles), so fresh installs get the CAMB AI button alongside the Forvo and JapanesePod101 buttons in the card creator's audio field.猫with readingねこsendsねこto Camb).getApplicationSupportDirectory()/cambAiAudio/keyed by language, voice id, and a hash of the text, so repeat lookups are instant and offline once cached.How a user turns it on
The API key is read from
String.fromEnvironment('CAMB_API_KEY'), so users pass it at build time:The build time define keeps this first iteration minimal. A natural follow up would be a Hive backed settings field next to the other enhancement settings, mirroring the existing pattern.
After install, in the card creator screen, users either tap the CAMB AI button directly in the audio field, or set it as the auto enhancement for the audio field in Settings.
Testing
No new unit tests, which matches the existing convention in
yuuna/lib/src/creator/enhancements/(neitherforvo_audio_enhancement.dartnorjapanesepod101_audio_enhancement.darthas unit tests). Verified by code review against those two existing implementations and by exercising the underlying Camb endpoint independently.About Camb AI
marsfamily. This integration usesmars-profor higher quality, since dictionary lookups are not latency critical and the audio is cached after the first request.