Code Monkey home page Code Monkey logo

text2audio_ocr's Introduction

text2audio_ocr

This repository contains Python code to extract text from an image using Optical Character Recognition (OCR), clean the extracted text by removing special characters, and generate text-to-speech (TTS) using gTTS.

Table of Contents

Requirements

  • Python 3.x
  • Tesseract OCR (for text extraction)
  • pytesseract library
  • gTTS library with the German language package

Installation

  1. Install Python 3.x if you don't have it already: Python Downloads

  2. Install Tesseract OCR:

    • On macOS: brew install tesseract
    • On Ubuntu/Debian: sudo apt-get install tesseract-ocr
    • On Windows: Download the installer from Tesseract OCR and follow the instructions.
  3. Install Python libraries: pip install pytesseract gTTS gtts-token

Example Suppose you have an image named "example.png" with english text. After running the script, the extracted text will be saved in "output_text.txt," and the generated German/english or any audio of your choice audio will be saved in "output_audio.mp3."

The extracted and cleaned text will be here

The content of "output_text.txt" You can listen to the generated German audio by playing the "output_audio.mp3" file.

#Caution This code provide a simple use case of text to speech conversion .For further understanding of ocr used in the code refer https://github.com/UB-Mannheim/tesseract image source:'https://wccftech.com/hackers-malware-subtitle-files/'

text2audio_ocr's People

Contributors

muddukrishna96 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.