Skip to main content

Command Palette

Search for a command to run...

How to Enable Speech-to-Text on Linux Mint 21.3

Published
7 min readView as Markdown

Enabling speech-to-text on Linux Mint 21.3 can make your computing experience much smoother. Whether you want to dictate documents, control your system by voice, or simply reduce typing, speech recognition is a handy feature. You might think it’s complicated on Linux, but with the right tools and setup, it’s easier than you expect.

In this guide, I’ll walk you through how to enable speech-to-text on Linux Mint 21.3. We’ll cover the best software options, installation steps, and tips to improve accuracy. By the end, you’ll be ready to use voice commands and dictation effortlessly on your Linux Mint system.

Understanding Speech-to-Text on Linux Mint 21.3

Linux Mint 21.3 is a popular, user-friendly Linux distribution based on Ubuntu. While Linux doesn’t have built-in speech-to-text like some other operating systems, you can still enable it using third-party tools and services.

Speech-to-text converts your spoken words into written text. It’s useful for writing emails, notes, or controlling your computer hands-free. On Linux Mint, you’ll mainly rely on open-source software or cloud-based services to get this feature.

Here are some common approaches:

  • Local speech recognition software: Runs entirely on your computer without internet.
  • Cloud-based speech recognition: Uses online services like Google or Mozilla to convert speech.
  • Hybrid solutions: Combine local software with cloud APIs for better accuracy.

Choosing the right method depends on your privacy preferences, internet access, and how accurate you want the recognition to be.

Several tools work well with Linux Mint 21.3 for speech-to-text. Here are some of the most popular and reliable ones:

1. Mozilla DeepSpeech

Mozilla DeepSpeech is an open-source speech-to-text engine based on deep learning. It runs locally on your machine, so your voice data stays private.

  • Pros:
    • Works offline.
    • Open-source and free.
    • Good accuracy with proper setup.
  • Cons:
    • Requires some technical setup.
    • Needs a decent CPU for real-time transcription.

2. Google Speech-to-Text API

Google offers a powerful cloud-based speech recognition API. You can use it on Linux Mint by connecting through software that supports it.

  • Pros:
    • Very accurate.
    • Supports many languages.
    • Easy to integrate with apps.
  • Cons:
    • Requires internet.
    • May incur costs after free usage limits.
    • Privacy concerns due to cloud processing.

3. Speech Recognition with Python (SpeechRecognition Library)

Python’s SpeechRecognition library supports multiple engines, including Google’s API and offline options.

  • Pros:
    • Flexible and scriptable.
    • Supports multiple backends.
  • Cons:
    • Requires Python knowledge.
    • Setup can be complex for beginners.

4. Julius

Julius is a lightweight, open-source speech recognition engine that works offline.

  • Pros:
    • Fast and lightweight.
    • Offline usage.
  • Cons:
    • Limited language models.
    • Less accurate than modern deep learning tools.

Step-by-Step Guide to Enable Speech-to-Text on Linux Mint 21.3

Let’s focus on a practical method using Mozilla DeepSpeech, as it balances privacy and usability well. I’ll also mention how to try Google’s API if you want cloud accuracy.

Step 1: Install Required Dependencies

Open your terminal and update your system:

sudo apt update && sudo apt upgrade -y

Install Python 3 and pip if you don’t have them:

sudo apt install python3 python3-pip -y

You’ll also need ffmpeg for audio processing:

sudo apt install ffmpeg -y

Step 2: Install DeepSpeech

Install DeepSpeech Python package:

pip3 install deepspeech

Download the pre-trained DeepSpeech model from Mozilla’s official GitHub releases page. For example:

wget https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/deepspeech-0.9.3-models.pbmm
wget https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/deepspeech-0.9.3-models.scorer

Step 3: Record Your Voice Input

You can record audio using arecord or any sound recorder. For example:

arecord -f cd -d 5 -t wav input.wav

This records 5 seconds of audio to input.wav.

Step 4: Transcribe Audio with DeepSpeech

Run the transcription command:

deepspeech --model deepspeech-0.9.3-models.pbmm --scorer deepspeech-0.9.3-models.scorer --audio input.wav

You’ll see the text output of your speech.

Step 5: Automate Speech-to-Text

To make this easier, you can write a simple script that records and transcribes automatically. This way, you can use speech-to-text without typing commands every time.

Using Google Speech-to-Text API on Linux Mint 21.3

If you want more accuracy and don’t mind using the cloud, Google’s API is a great option.

How to Set It Up:

  • Create a Google Cloud account and enable the Speech-to-Text API.
  • Download your API credentials JSON file.
  • Install the google-cloud-speech Python package:
pip3 install google-cloud-speech
  • Use a Python script to send your audio to Google and get the transcription.

This method requires internet and some setup but offers excellent recognition quality.

Tips to Improve Speech-to-Text Accuracy on Linux Mint

Getting good results depends on more than just software. Here are ways to improve your experience:

  • Use a quality microphone: Clear audio input reduces errors.
  • Speak clearly and at a moderate pace: Avoid mumbling or rushing.
  • Reduce background noise: Use a quiet room or noise-cancelling mic.
  • Train your model if possible: Some tools let you customize for your voice.
  • Use proper audio formats: WAV files with 16kHz sample rate work best.
  • Keep software updated: Newer versions improve recognition.

Integrating Speech-to-Text with Linux Mint Applications

Once you have speech-to-text working, you might want to use it with your favorite apps.

  • Text editors: Use scripts to paste transcribed text directly into editors like LibreOffice or Gedit.
  • Command line: Control your terminal with voice commands using custom scripts.
  • Accessibility tools: Combine speech-to-text with screen readers for better accessibility.
  • Chat applications: Dictate messages in apps like Telegram or Slack.

You can create keyboard shortcuts or custom launchers to start speech recognition quickly.

Troubleshooting Common Issues

Sometimes speech-to-text might not work as expected. Here’s what to check:

  • No audio input detected: Verify your microphone is connected and recognized by Linux Mint.
  • Poor transcription quality: Try a better microphone or reduce background noise.
  • DeepSpeech errors: Ensure you downloaded the correct model files and installed dependencies.
  • Google API errors: Check your API key and internet connection.
  • Permission issues: Make sure your user has access to audio devices.

Running arecord -l in the terminal lists available audio devices to help diagnose input problems.

Alternatives and Future of Speech-to-Text on Linux Mint

The Linux ecosystem is evolving rapidly. New tools and improvements are coming that will make speech-to-text easier and more accurate.

  • Coqui STT: A fork of DeepSpeech with active development and better models.
  • OpenAI Whisper: A powerful open-source speech recognition model that runs locally.
  • Integration with GNOME and KDE: Desktop environments are adding native voice input support.

Keep an eye on Linux Mint forums and GitHub projects for the latest updates.


Enabling speech-to-text on Linux Mint 21.3 is very doable with the right tools. Whether you choose Mozilla DeepSpeech for offline privacy or Google’s API for cloud accuracy, you can start dictating and controlling your system by voice today. With some setup and practice, you’ll find speech recognition a useful addition to your Linux workflow.

Remember to use a good microphone and quiet environment for best results. As Linux speech-to-text technology improves, your experience will only get better. Try the steps here, experiment with different tools, and enjoy hands-free computing on Linux Mint 21.3.

FAQs

How do I check if my microphone works on Linux Mint 21.3?

Open the terminal and run arecord -l to list audio capture devices. You can also test recording with arecord -f cd test.wav and play it back to confirm your mic works.

Can I use speech-to-text offline on Linux Mint?

Yes, tools like Mozilla DeepSpeech and Julius allow offline speech recognition, keeping your data private without needing internet access.

Is Google Speech-to-Text free to use on Linux Mint?

Google offers a free tier with limited minutes per month. Beyond that, charges apply based on usage. You need a Google Cloud account and API key.

What audio format is best for speech-to-text?

WAV files with a 16kHz sample rate and mono channel are ideal for most speech recognition engines, including DeepSpeech and Google API.

Can I control Linux Mint with voice commands?

Yes, by combining speech-to-text with scripting, you can create voice commands to open apps, run scripts, or control system functions.

More from this blog

L

LinuxBloke | Linux Tips, Tricks & Troubleshooting

672 posts