On-device Transcription with 3 lines of Python

dilek

Dilek Karasoy

Posted on February 6, 2023

On-device Transcription with 3 lines of Python

On day 26, we'll cover on-device transcription with 3 lines of Python.

Requirements:

  1. Picovoice AccessKey - you can grab yours from the Picovoice Console for free.
  2. Leopard Speech-to-Text Python SDK
pip install pvleopard
Enter fullscreen mode Exit fullscreen mode

Let's get started!

  1. Import Leopard Speech-to-Text
import pvleopard
Enter fullscreen mode Exit fullscreen mode
  1. Create an instance with your AccessKey:
handle = pvleopard.create(access_key)
Enter fullscreen mode Exit fullscreen mode

Don't forget to replace the access_key with the one you grabbed from the Picovoice Console.

  1. Transcribe an audio file:
transcript, words = handle.process_file(audio_path)
Enter fullscreen mode Exit fullscreen mode

Don't forget to replace the audio_path with the path for the file you want to transcribe.

DONE!

This tutorial is first published on picovoice.ai

💖 💪 🙅 🚩
dilek
Dilek Karasoy

Posted on February 6, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

End-to-End Speech Recognition with Python
100daysofcode End-to-End Speech Recognition with Python

March 8, 2023

On-device Transcription with 3 lines of Python
100daysofcode On-device Transcription with 3 lines of Python

February 6, 2023

Day 14: Youtube Voice Search with Python
100daysofcode Day 14: Youtube Voice Search with Python

January 19, 2023