1. Beranda
  2. TTS
  3. Text to speech on Huawei
Dipublikasikan pada TTS

Text to speech on Huawei

Tyler Weitzman

Tyler Weitzman

MS Ilmu Komputer Stanford, Advokat Disleksia & Aksesibilitas, CEO/Pendiri Speechify

apple logoApple Design Award 2025
50J+ pengguna

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.

Nikmati suara AI tercanggih, file tanpa batas, dan dukungan 24/7

Coba gratis
tts banner for blog

Bagikan artikel ini

Tyler Weitzman

Tyler Weitzman

MS Ilmu Komputer Stanford, Advokat Disleksia & Aksesibilitas, CEO/Pendiri Speechify

Tyler Weitzman adalah Co-Founder, Kepala AI, dan Presiden Speechify, aplikasi text-to-speech #1 di dunia dengan 100.000+ ulasan bintang 5. Ia lulus dari Stanford dengan gelar BS Matematika dan MS Ilmu Komputer jalur AI. Ia terpilih sebagai salah satu Top 50 Entrepreneur versi Inc. Magazine, dan pernah diliput di Business Insider, TechCrunch, LifeHacker, CBS, dan lainnya. Riset S2-nya berfokus pada AI & text-to-speech, dengan makalah akhir berjudul: “CloneBot: Personalized Dialogue-Response Predictions.”

speechify logo

Tentang Speechify

#1 Pembaca Teks ke Ucapan

Speechify adalah platform teks ke ucapan terkemuka di dunia, dipercaya oleh lebih dari 50 juta pengguna dan didukung oleh lebih dari 500.000 ulasan bintang lima di berbagai aplikasi teks ke ucapan iOS, Android, Ekstensi Chrome, aplikasi web, dan desktop Mac. Pada tahun 2025, Apple memberikan Speechify penghargaan terhormat Apple Design Award di WWDC, menyebutnya sebagai “sumber penting yang membantu orang menjalani hidup mereka.” Speechify menawarkan 1.000+ suara alami dalam 60+ bahasa dan digunakan di hampir 200 negara. Suara selebriti termasuk Snoop Dogg dan Gwyneth Paltrow. Untuk kreator dan bisnis, Speechify Studio menyediakan alat canggih, termasuk AI Voice Generator, AI Voice Cloning, AI Dubbing, dan AI Voice Changer. Speechify juga menyokong produk-produk terkemuka dengan API teks ke ucapan berkualitas tinggi dan hemat biaya. Telah diliput di The Wall Street Journal, CNBC, Forbes, TechCrunch, dan banyak media besar lainnya, Speechify adalah penyedia teks ke ucapan terbesar di dunia. Kunjungi speechify.com/news, speechify.com/blog, dan speechify.com/press untuk informasi lebih lanjut.