Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Oct 27, 2023
1 parent b37c0d9 commit 159b054
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,13 @@ class MainActivity : AppCompatActivity() {
return
}

play.isEnabled = false;
val audio = tts.generate(text = textStr, sid = sidInt, speed = speedFloat)

val filename = application.filesDir.absolutePath + "/generated.wav"
val ok = audio.samples.size > 0 && audio.save(filename)
if (ok) {
play.isEnabled = true
Toast.makeText(
applicationContext,
"Generated! Please click play to listen to it",
Toast.LENGTH_SHORT
).show()
} else {
play.isEnabled = false
}
}

Expand Down

0 comments on commit 159b054

Please sign in to comment.