Skip to content
This repository was archived by the owner on Jun 22, 2025. It is now read-only.
This repository was archived by the owner on Jun 22, 2025. It is now read-only.

after doing all things , my python file is running fine in the terminal but i am not getting the UI #188

Closed

Description

@ankushbanik1

`from gtts import gTTS
import pyaudio
from pydub import AudioSegment
import pandas as pd
import eel

eel.init('web')

@eel.expose
def Speechtotext(text, filename):
mytext=str(text)
language='hi'
obj=gTTS(text=mytext,lang=language,slow=True)
obj.save(filename)
@eel.expose
def mergeaudio(audios):
combiend=AudioSegment.empty()
for audio in audios:
combiend+=AudioSegment.from_mp3(audio)

return combiend    

@eel.expose
def generateSkeliton():
audio=AudioSegment.from_mp3("railway.mp3")
#kripiya_dhayan_dijiye....1_hindi.mp3

start=88000
finish=90200
audioProcced=audio[start:finish]
audioProcced.export("1_hindi.mp3",format="mp3")
#From_city
#####################

#se_chalkar
start=91000
finish=92200
audioProcced=audio[start:finish]
audioProcced.export("3_hindi.mp3",format="mp3")
#Via_city.....................
##################
#ke Raste......
start=94000
finish=95000
audioProcced=audio[start:finish]
audioProcced.export("5_hindi.mp3",format="mp3")
#To_city......
#########################
#Janawali Gari.....
start=96000
finish=98900
audioProcced=audio[start:finish]
audioProcced.export("7_hindi.mp3",format="mp3")
#Train No and Name....................
####################################
#kuch hi samay me platform sankhaya....
start=105500
finish=108800
audioProcced=audio[start:finish]
audioProcced.export("9_hindi.mp3",format="mp3")
#platform sankhay...
######################
#aa rahi ha.......
start=109000
finish=112250
audioProcced=audio[start:finish]
audioProcced.export("11_hindi.mp3",format="mp3")

@eel.expose
def generateannouncement(filename):
df=pd.read_excel(filename)
print(df)
for index,item in df.iterrows():
# 2 - Generate from-city
Speechtotext(item["from"],"2_hindi.mp3")

    # 4 - Generate via-city
    Speechtotext(item["via"],"4_hindi.mp3")

    # 6 - Generate to-city
    Speechtotext(item["to"],"6_hindi.mp3")

    # 8 - Generate train no and name
    Speechtotext(item["train_no"]+"    "+item["train_name"],"8_hindi.mp3")

    # 10 - Generate platform number

    Speechtotext(item["platform"],"10_hindi.mp3")

    audioss=[f"{i}_hindi.mp3" for i in range(1,12)]
    announcement = mergeaudio(audioss)

    announcement.export(f"announcement_{item['train_name']}_{index+1}.mp3",format='mp3')

@eel.expose
def maker():

print("genatering Skeliton...")

generateSkeliton()
print("Generating Announcement")

generateannouncement("announce.xlsx")

maker()

eel.start('index.html', size=(1000, 600))
`

Activity

  1. samuelhwilliams commented on Oct 3, 2019

    @samuelhwilliams
    Collaborator

    Can you share the git repo for your code so I can try it out locally?

    Also, if you see any error messages, can you share those here as well please?

  2. samuelhwilliams commented on Oct 21, 2019

    @samuelhwilliams
    Collaborator

    I'm going to assume that you got to the bottom of this issue. If I'm wrong, please feel free to comment back here with more details and we'll see if we can help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions