Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
id 'org.ajoberstar.grgit'
}

def libVersion = '1.0.5-SNAPSHOT'
def libVersion = '1.0.6-SNAPSHOT'
def group = "ai.elimu.common"
def artifact = "utils"

Expand All @@ -18,7 +18,7 @@ android {
defaultConfig {
minSdk 26

versionCode 1000005
versionCode 1000006
versionName libVersion
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ class TextToSpeechWrapper(context: Context, language: String, contentProviderId:
Log.d(TAG, "init TextToSpeech DONE. status: $status")
if (status == TextToSpeech.SUCCESS) {
tts.setSpeechRate(0.5f)
if (language.isNotEmpty()) {
tts.setLanguage(language.toLanguage().toLocale())
} else {
tts.setLanguage(contentProviderLanguage.toLanguage().toLocale())

val sttLanguage = language.ifEmpty {
Copy link
Member

@jo-elimu jo-elimu Apr 3, 2025

Choose a reason for hiding this comment

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

@tuancoltech The language variable here should probably be removed as a parameter? (Since the apps using this utils library don't know which language to use.)

class TextToSpeechWrapper(context: Context, language: String, contentProviderId: String)

class TextToSpeechWrapper(context: Context, contentProviderId: String)

Copy link
Member Author

Choose a reason for hiding this comment

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

@jo-elimu The language parameter here is for apps to be able to pass a custom TTS language to the TextToSpeech engine, disregard the one selected in ContentProvidre.
It's for the future.

contentProviderLanguage
}
tts.setLanguage(sttLanguage.lowercase().toLanguage().toLocale())
} else {
Log.e(TAG, "TTS initialization failed with status: $status")
}
Expand Down