1. Avaleht
  2. TTS
  3. Text to speech on Huawei
Avaldatud TTS

Text to speech on Huawei

Tyler Weitzman

Tyler Weitzman

Stanfordi ülikooli arvutiteaduse magistrikraadiga, düsleksia ja ligipääsetavuse eestkõneleja, Speechify tegevjuht ja asutaja

apple logo2025. aasta Apple'i disainiauhind
50M+ kasutajat

Text to speech on Huawei

If you find a Samsung mobile device’s cost too high or want an alternative, you might try a Huawei phone. Though these devices often have downsides, such as the lack of access to the Google Play store, they still run the Android operating system.

That means you can use built-in text to speech (TTS) readers for verbal playback. Let’s look at how to do that and check out some programming techniques you can use to expand on Huawei’s TTS features.

Who is Huawei?

Since its founding in 1987, Huawei has established itself as a leading electronics and communication technology provider. The Chinese company operates in over 170 countries and employs 195,000 people.

Most know Huawei as the manufacturer of a range of cost-effective mobile devices, such as smartphones. Most of these devices use a version of the Android operating system. However, they have limitations due to many American companies having data-related concerns.

Even so, Huawei is a world-leading technology company that offers a variety of helpful devices and services.

How to enable the TalkBack TTS engine on Huawei devices

Huawei has a built-in text to screen reader named TalkBack. It functions similarly to VoiceOver, which you can find on Apple’s iPhone and iPad.

The app gives you voice feedback, which means it reads anything on your screen aloud. You can also operate a Huawei phone with voice commands – you don’t have to look at the screen. As such, TalkBack is ideal for visually impaired people.

Here’s how to activate TalkBack:

  1. Open “Settings” and select “Accessibility Features.”
  2. Tap “Accessibility.”
  3. Choose “TalkBack” and enable the software.
  4. Tap “OK.”

Disabling TalkBack

If you want to turn TalkBack off, hold your phone’s power button until it displays the “Restart” and “Power Off” icons. Then, touch the screen and hold for three seconds to deactivate TalkBack.

Converting text to speech

Once TalkBack is activated, do the following to have it turn digital text into speech:

  1. Open “Settings” and navigate to the “Accessibility” screen.
  2. Tap “Text to speech” and select your desired text to speech engine.
  3. Adjust the speech rate and pitch to your preferences.

Note that you can use these steps to turn text to speech on for any TTS app installed on your Huawei device. Once activated, your phone will read any text information it sees out loud.

Adding voice to an Android application using MLTtsengine.speak

Huawei devices feature the MLTtsengine.speak development kit. This kit allows you to add text to speech functionality to any Android app you create using the device.

Here are the basic steps using information from a developer named Tushar Srivastava:

  1. Create a new project using Android Studio.
  2. Add the following dependency to the project:
    • implementation 'com.huawei.hms:ml-computer-voice-tts:1.0.4.300'
  3. Add the AGC plugin to the top of the app.gradle file using this code:
    • apply plugin: 'com.huawei.agconnect'
  4. Create a callback in your Android Studio activity using the following code:

var callback: MLTtsCallback = object : MLTtsCallback {

override fun onError(taskId: String, err: MLTtsError) {

}

override fun onWarn(taskId: String, warn: MLTtsWarn) {

}

override fun onRangeStart(taskId: String, start: Int, end: Int) {

}

override fun onEvent(taskId: String, eventName: Int, bundle: Bundle?) {

if (eventName == MLTtsConstants.EVENT_PLAY_STOP) {

val isStop = bundle?.getBoolean(MLTtsConstants.EVENT_PLAY_STOP_INTERRUPTED)

}

}

  1. Initialize the object using the following lines of code:

mlConfigs = MLTtsConfig()

.setLanguage(MLTtsConstants.TTS_EN_US)

.setPerson(MLTtsConstants.TTS_SPEAKER_FEMALE_EN)

.setSpeed(1.0f)

.setVolume(1.0f)

mlTtsEngine = MLTtsEngine(mlConfigs)

mlTtsEngine.setTtsCallback(callback)

  1. Create the below method in your activity so that you can access your text to speech output in your app with a button click:

private fun startTtsService() { val id = mlTtsEngine.speak(sourceText,MLTtsEngine.QUEUE_APPEND)}

Other Useful Callback methods

The Huawei APIs offer several callback methods for using audio data and text to speech in an app. Here are the four most common.

Public void onError()

If an error occurs, the control flow heads to this error callback. It’s used to advise an app user that an error occurred and request they send analytics data to the appropriate place for verification.

Public void onWarn()

The callback flows here if the user experiences a warning, such as not having enough bandwidth for the app.

Public void onEvent()

Use this callback whenever a new event occurs, such as the user pausing audio.

Public void onRangeStart()

This callback returns the mapping between the currently playing segment and the text the user wants to read.

Additional Notes

Any new mlttscallback routine you create has limitations. In the above example, characters get encoded in UTF-8, and you have a 500-character limit.

On the plus side, the function supports male and female voices in English, Mandarin Chinese, and a combination of both.

Speechify - The alternative to Talkback

As you can see, using a Huawei device to read on-device text can get complicated. However, if you’re not keen on programming, an alternative text to speech app can read any text to you in real-time.

That app is Speechify.

Available for all Android devices, Speechify uses speech synthesis technology to provide a range of human-sounding voices in several timbres. Users can choose between over 14 languages and adjust the readout speed as they see fit.

And when you’re not using the app, just shutdown, and you can read the text as you normally would.

If you’d like to learn more about how Speechify can work on your Huawei device, test out a free trial today. You can also use the reader in your browser.

FAQ

How do I turn on text to speech on my Huawei?

Use the directions in this article to activate the TalkBack app.

How do you dictate on Huawei?

Enter your device’s “Control Panel” and head to “Ease of Access.” Select “Speech Recognition” and tap “Start Speech Recognition.”

Is there text to speech on Android?

Beyond TalkBack, you can access many TTS engines for an Android phone.

Naudi tipptasemel AI-hääli, piiramatult faile ja ööpäevaringset kliendituge

Proovi tasuta
tts banner for blog

Jaga seda artiklit

Tyler Weitzman

Tyler Weitzman

Stanfordi ülikooli arvutiteaduse magistrikraadiga, düsleksia ja ligipääsetavuse eestkõneleja, Speechify tegevjuht ja asutaja

Tyler Weitzman on Speechify kaasasutaja, tehisintellekti juht ja president. Speechify on maailma juhtiv kõnesünteesi rakendus, millel on üle 100 000 viietärni arvustuse. Weitzman lõpetas Stanfordi ülikooli, kaitstes matemaatika bakalaureusekraadi ja arvutiteaduse magistrikraadi tehisintellekti erialal. Inc. Magazine nimetas ta Top 50 ettevõtja hulka ning teda on kajastatud väljaannetes Business Insider, TechCrunch, LifeHacker, CBS jm. Tema magistriõpingud keskendusid tehisintellektile ja kõnesünteesile. Lõputöö kandis pealkirja “CloneBot: Personalized Dialogue-Response Predictions”.

speechify logo

Speechify'st

#1 tekst kõneks rakendus

Speechify on maailma juhtiv tekst kõneks platvorm, mida usaldab üle 50 miljoni kasutaja ja millele on antud enam kui 500 000 viietärnilist arvustust selle tekstist kõneks tehnoloogia eest iOS-, Android-, Chrome Extension-, veebirakendus- ja Mac desktop-rakendustes. 2025. aastal pälvis Speechify Apple’ilt prestiižse Apple’i disainiauhinna WWDC-l, nimetades seda „oluliseks ressursiks, mis aitab inimestel paremini elada.” Speechify pakub üle 1 000 loodusliku kõlaga hääle rohkem kui 60 keeles ning seda kasutatakse ligi 200 riigis. Kuulsuste häältest on saadaval näiteks Snoop Dogg ja Gwyneth Paltrow. Loojatele ja ettevõtetele pakub Speechify Studio täiustatud tööriistu, sh AI-häälegeneraatorit, AI-häälekloonimist, AI-dubleerimist ja AI-häälevahetust. Speechify panustab ka juhtivatesse toodetesse tänu kvaliteetsele ja kuluefektiivsele tekst kõneks API-le. Esindatud näiteks The Wall Street Journal, CNBC, Forbes, TechCrunch ja muudes juhtivates meediakanalites, on Speechify maailma suurim kõnesünteesi teenusepakkuja. Vaata lisaks: speechify.com/news, speechify.com/blog ja speechify.com/press.