Posts

Text to speak python Project

NA PROJECT REPORT ( Read To Speak ) Project File Structure 1.       Importing various modules 2.      Initializing main window 3.      Read to speak function 4.      Voice change 5.      Rest Code   Read to speak is a process to convert any text into voice. Read to speak project takes words on digital devices and convert them into audio. Here I have used Google-text-to-speech library popularly known as gTTS library to convert text file to .mp3 file. The gTTS library supports several languages including English, French, German and many more. And before getting started in this project you have to install couple of python libraries like gTTS and playsound. In order to download the libraries, open your terminal and write (pip install gtts ) and (pip install playsound). In this project I have written the description of each line of code, this will make you clear with the coding se...

SQL Send Query Post man Use FastApi

   To create a directory and save a video in a FastAPI application in Python, you can use . Here's an example: python import os import pyodbc import uvicorn as uvicorn from fastapi import FastAPI , UploadFile , File , Header app = FastAPI() @app.post ( '/api/sqlquery' ) def SQlQueryRun (sql_query: str ): # Replace with your own connection string # print(sql_query) connection_string = 'Driver={SQL Server};Server=DESKTOP-FD8825Q\SQLEXPRESS;Database=MEYEPRO;Trusted_Connection=yes;' # connection_string = f"DRIVER={driver};SERVER={server};DATABASE={database};UID={username};PWD={password}" cnxn = pyodbc.connect(connection_string) cursor = cnxn.cursor() cursor.execute(sql_query) columns = [column[ 0 ] for column in cursor.description] data = [] for row in cursor.fetchall(): data.append( dict ( zip (columns , row))) cursor.close() cnxn.close() return data uvicorn.run(app , host = "192.168.100.12...

Thread create in Android

  In Android, you can create a new thread to run tasks in parallel with the main thread. There are several ways to create threads in Android: Extending the Thread class: java Copy code class MyThread extends Thread {  @Override public void run () {  // Your code to run in the new thread    }  }  // To start the thread:   MyThread thread = new MyThread ();  thread.start(); Implementing the Runnable interface: java Copy code class MyRunnable implements Runnable { @Override   public void run ()   { // Your code to run in the new thread    }  } // To start the thread:   Thread thread = new Thread ( new MyRunnable ());  thread.start(); Using the Executor framework: java Copy code Executor executor = Executors.newSingleThreadExecutor();  executor.execute( new Runnable ()  {  @Override   public void run ()   {  // Your code to run in the new thread ...