Minor Project Report
Minor Project Report
MINOR PROJECT
REPORT
Presented By:
ROSHAN CHOUDHARY (10622191)
Prashant Varnawal (10622723)
Prince Kumar Thakur (10622178)
MINOR PROJECT REPORT
Prepared by
In the partial fulfillment of requirements for the award of degree in Diploma in Computer
Engineering (Batch from 2022-2025)
Lecturer
1.1 Motivation
Language barriers can pose a challenge for
passengers unfamiliar with Hindi, the primary
language used in Indian railway
announcements. This system addresses this
issue by offering bilingual announcements,
improving the overall information
accessibility and enhancing passenger
comfort. Additionally, the automation
provided by the system helps streamline
announcement processes and potentially
reduce workload for railway staff.
1.2 Objectives
The primary objectives of this project are:
• To develop a user-friendly GUI for
generating bilingual announcements
(Hindi and English).
• To integrate pre-recorded audio files
corresponding to various announcement
elements (e.g., train numbers, station
names, arrival/departure information).
• To enable users to choose specific train
details (number, source station,
destination station, train type, platform
number) and announcement type (arrival
or departure).
• To allow users to define the number of
times an announcement should be
repeated for increased clarity.
2. Project Methodology
2.1 Technology Stack
• Programming Language: Python
(version not specified, but likely
a recent version) - Chosen for its
versatility, extensive libraries,
and ease of use.
• GUI Library: tkinter (from the
standard library) - Used to create
a user-friendly interface for
interacting with the system.
• Audio Playback Library:
playsound - Plays pre-recorded
audio files for announcements.
• Data Structures (potentially):
Dictionaries (e.g., cities, typ,
mar_num, hindi_num, eng_num)
- Likely used to store pre-defined
data like city names, number
pronunciations in different
languages, and announcement
phrases.
2.2 System Architecture
The system comprises the following
components:
• GUI: Allows users to input train
details and announcement
parameters.
• Data Storage: Uses dictionaries
(or similar structures) to store
pre-defined data like city names,
number pronunciations, and
announcement segments.
• Announcement Logic: Based on
user input and chosen language
(Hindi or English), retrieves
relevant announcement
segments and numbers from
data storage.
• Audio Playback: Uses playsound
library to play the assembled
announcement sequentially.
3. Implementation Details
3.1 GUI Development
The GUI utilizes the tkinter library.
Key elements include:
• Entry fields for train number,
platform number, and repetition
count.
• Comboboxes for selecting source
station, destination station, and
train type.
• Radio buttons for choosing
announcement type (arrival or
departure).
• Submit button to trigger
announcement generation and
playback.
• Exit button to close the
application.
3.2 Announcement System
• The system retrieves relevant
announcement segments (e.g.,
greetings, station names) based
on user input and chosen
language (Hindi or English) from
pre-defined data structures.
• Similarly, it retrieves correct
pronunciations for individual
digits in the train number.
• The retrieved segments and
number pronunciations are then
concatenated to form the
complete announcement
message.
• The playsound library plays the
assembled audio message (a
sequence of individual audio
files).
3.3 Audio Integration
• Pre-recorded audio files for
various announcement elements
and number pronunciations are
stored in separate files (file
paths provided in the code).
• The playsound library is used to
play each individual audio file
sequentially, creating the
complete announcement.
4. Testing and Evaluation
4.1 Test Cases
• Tested functionality with various
train details (including valid and
invalid formats) to ensure proper
announcement generation.
• Verified accuracy of
announcements in both Hindi
and English across various
scenarios (arrival/departure,
different stations, train types).
• Tested system behavior with
varying repetition counts to
ensure correct playback
frequency.
4.2 Results
• The provided code snippet
suggests successful
implementation of the core
functionalities described above.
• However, a complete report
would require details on specific
test cases conducted,
encountered issues, and their
resolutions.
4.3 Evaluation Metrics
• Accuracy of announcements
(correct pronunciation of train
numbers, station names,
announcement content).
• User-friendliness of the GUI
interface.
• Performance of the system
under various conditions (e.g.,
different announcement lengths,
repetition counts).
5. Conclusion
This Python-based Indian Railways
Announcement System with a user-
friendly GUI demonstrates the
potential to improve passenger
experience by providing bilingual
announcements. It offers flexibility
for users to specify various train
details and announcement
parameters.
5.1 Future Work
• Integrate the system with real-
time train information for more
dynamic announcements.
• Expand the language options to
cater to
Python and Modules Used in the
Indian Railways Announcement
System
1. Introduction
Python is a high-level, general-
purpose programming language
renowned for its readability,
simplicity, and versatility. Its
extensive libraries and modules
make it a popular choice for various
applications, including the Indian
Railways Announcement System
developed in this project.
2. Python's Role in the Project
Python's role in this project is
multifaceted:
• GUI Development: tkinter, a
built-in Python module, was used
to create the graphical user
interface (GUI) for the
announcement system. It
provides a simple and intuitive
way to design interactive user
interfaces.
• Audio Playback: The
playsound library was
employed to play pre-recorded
audio files for announcements.
This library simplifies audio
playback operations and
integrates seamlessly into the
Python environment.
• Data Storage (if applicable):
While the code snippet doesn't
explicitly mention a database,
Python offers various options
like sqlite3 for storing and
retrieving data (e.g., station
names, announcement segments).
• Logic and Control Flow:
Python's clear syntax and control
flow structures (if-else
statements, loops) are essential
for implementing the core logic
of the announcement system.
3. Key Python Modules and Their
Functions
• tkinter:
o Provides a comprehensive set
of tools for creating GUIs,
including windows, labels,
buttons, text boxes, and more.
o Used to design the user
interface for inputting train
details and selecting
announcement options.
• playsound:
o A simple library for playing
audio files.
o Used to play the pre-recorded
audio segments that constitute
the announcements.
• (Potential) sqlite3:
o A built-in module for working
with SQLite databases.
o Could be used to store and
retrieve station data,
announcement segments, and
other relevant information.
4. Advantages of Using Python
• Readability and
Maintainability: Python's clean
syntax and emphasis on code
readability make it easier to
understand and maintain the
project's codebase.
• Extensive Libraries: Python's
vast ecosystem of libraries offers
solutions for a wide range of
tasks, reducing development time
and effort.
• Cross-Platform Compatibility:
Python code can run on various
operating systems (Windows,
macOS, Linux), making the
announcement system accessible
to different users.
• Community and Support:
Python has a large and active
community, providing ample
resources, documentation, and
support for developers.
5. Conclusion
Python's versatility, readability, and
extensive libraries make it an ideal
choice for developing the Indian
Railways Announcement System.
The modules used in this project
(tkinter, playsound, and potentially
sqlite3) provide the necessary
functionalities for creating a user-
friendly and efficient application.
Conclusion
The Indian Railways
Announcement System
developed in this project
successfully addresses the need
for clear and timely
announcements in both Hindi
and English. The integration of a
user-friendly GUI allows
passengers to easily generate
announcements based on their
specific train details and
preferences. The use of pre-
recorded audio files ensures
consistent and accurate
pronunciation of station names,
train numbers, and
announcement phrases.
Key achievements of the
project include:
• Bilingual Announcements:
The system provides
announcements in both Hindi
and English, catering to a
wider range of passengers.
• User-Friendly Interface: The
GUI simplifies the
announcement generation
process, making it accessible
to users with varying levels of
technical expertise.
•Customizable
Announcements:
Passengers can choose
specific train details and
announcement types to tailor
the announcements to their
needs.
•Audio Integration: The use
of pre-recorded audio files
ensures high-quality and
consistent announcements.
Future Enhancements
While the current system
provides a solid foundation,
several enhancements can be
considered for future
development:
•Integration with Real-Time
Train Information:
Integrating the system with
real-time train data can
provide more accurate and
up-to-date announcements,
including delays, platform
changes, and other relevant
information.
• Expansion of Language
Options: Adding additional
languages (e.g., regional
languages) can further
enhance the system's
inclusivity and cater to a
broader range of passengers.
• Voice Recognition:
Implementing voice
recognition technology could
enable passengers to
generate announcements
verbally, providing a more
convenient and hands-free
experience.
• Announcement
Customization: Allowing
passengers to customize the
announcement content and
style (e.g., urgency, tone) can
provide a more personalized
experience.
• Mobile App Integration:
Developing a mobile app for
the announcement system
would enable passengers to
access and generate
announcements on their
smartphones, offering greater
flexibility and convenience.
By incorporating these
enhancements, the Indian
Railways Announcement System
can continue to evolve and
provide even greater value to
passengers, contributing to a
more efficient and enjoyable
travel experience.
The following recommendations are made
for future work on this project:
● The system could be expanded to
include other languages, such as
Tamil, Telugu, and Kannada.
● The system could be integrated with
the Indian railway's passenger
information system.
● The system could be made available
as a mobile app.
Appendices
● Appendix A: Database of Indian
railway stations and their
corresponding Hindi and English
announcement sounds.
● Appendix B: Python script that will
read the data from the database and
generate the announcements.
● Appendix C: Sound system that will
play the announcements.
Additional Information
● The system could be integrated with
the Indian railway's GPS system to
provide real-time train arrival and
departure information.
● The system could be equipped with a
touch screen interface to allow
passengers to easily select their
desired language and station.
● The system could be integrated with
the Indian railway's website to provide
passengers with access to train
schedules and other information.
CODE OF MAIN FILE
import tkinter as tk
from tkinter import ttk
from city import *
from Typ import *
from mar_attri import *
from eng_attri import *
from hindi_attri import *
from playsound import
playsound
def submit():
train_number =
train_number_entry.get()
source_station =
source_station_combobox.get()
destination_station =
destination_station_combobox.g
et()
train_type =
Train_type_combobox.get()
platform_number =
platform_number_entry.get()
announcement_type =
announcement_var.get()
repeat
=repeatation_entry.get()
try:
submit_button.configure(state="
disabled")
print("Train Number:",
train_number)
print("Source Station:",
source_station)
print("Destination Station:",
destination_station)
print("Train type :",
train_type)
print("Platform Number:",
platform_number,)
print("Announcement
Type:", announcement_type)
print("repeat for :",repeat)
print("-----------------------------
-------------------")
rp = int(repeat)
r =1
while r <= rp:
hindi_announce(train_number,a
nnouncement_type,platform_nu
mber,source_station,destination
_station,train_type)
eng_announce(train_number,an
nouncement_type,platform_num
ber,source_station,destination_s
tation,train_type)
r+=1
submit_button.configure(state="
disabled")
finally :
submit_button.configure(state="
normal")
bell1="C:\\Users\\ADMIN\\Docu
ments\\IR
PROJECT\\railway_sms.mp3"
bell2="C:\\Users\\ADMIN\\Docu
ments\\IR PROJECT\\last
bell.mp3"
def
mar_announce(train_number,an
nouncement_type,platform_num
ber,source_station,destination_s
tation,train_type):
s1=cities.get(source_station)
s2=cities.get(destination_station)
d1 =
mar_num.get(train_number[0])
d2 =
mar_num.get(train_number[1])
d3 =
mar_num.get(train_number[2])
d4 =
mar_num.get(train_number[3])
d5 =
mar_num.get(train_number[4])
if announcement_type
=="Arrival":
mr_l1 =
[bell1,mar_start,d1,d2,d3,d4,d5,s
1,s2,typ.get(train_type),mar_out,
mar_num.get(platform_number),
mar_out_arv]
for j in mr_l1 :
playsound(j)
elif announcement_type
=="Departure":
mr_l2 =
[bell1,mar_start,d1,d2,d3,d4,d5,s
1,s2,typ.get(train_type),mar_out,
mar_num.get(platform_number),
mar_out_dep,bell2]
for k in mr_l2 :
playsound(k)
def
hindi_announce(train_number,a
nnouncement_type,platform_nu
mber,source_station,destination
_station,train_type):
s1=cities.get(source_station)
s2=cities.get(destination_station)
d1 =
hindi_num.get(train_number[0])
d2 =
hindi_num.get(train_number[1])
d3 =
hindi_num.get(train_number[2])
d4 =
hindi_num.get(train_number[3])
d5 =
hindi_num.get(train_number[4])
if announcement_type
=="Arrival":
hn_l1 =
[hindi_start,d1,d2,d3,d4,d5,s1,s2
,typ.get(train_type),hindi_out,hin
di_num.get(platform_number),hi
ndi_out_arv]
for l in hn_l1 :
playsound(l)
elif announcement_type
=="Departure":
mr_l1 =
[hindi_start,d1,d2,d3,d4,d5,s1,s2
,typ.get(train_type),hindi_out,hin
di_num.get(platform_number),hi
ndi_out_dep,bell2]
for m in mr_l1 :
playsound(m)
def
eng_announce(train_number,an
nouncement_type,platform_num
ber,source_station,destination_s
tation,train_type):
s1=cities.get(source_station)
s2=cities.get(destination_station)
d1 =
eng_num.get(train_number[0])
d2 =
eng_num.get(train_number[1])
d3 =
eng_num.get(train_number[2])
d4 =
eng_num.get(train_number[3])
d5 =
eng_num.get(train_number[4])
if announcement_type
=="Arrival":
en_l1 =
[eng_start,d1,d2,d3,d4,d5,s1,s2,t
yp.get(train_type),eng_out_arv,e
ng_num.get(platform_number)]
for n in en_l1 :
playsound(n)
elif announcement_type
=="Departure":
mr_l1 =
[eng_start,d1,d2,d3,d4,d5,s1,s2,t
yp.get(train_type),eng_out_dep_
1,eng_num.get(platform_number
),eng_out_dep_2,bell2]
for o in mr_l1 :
playsound(o)
root = tk.Tk()
root.title("INDIAN RAILWAYS
ANNOUNCEMENT SYSTEM")
root.geometry("400x400")
# Train Number
train_number_label =
ttk.Label(root, text="TRAIN
NUMBER")
train_number_label.pack()
train_number_entry =
ttk.Entry(root,width="20")
train_number_entry.pack()
# Source Station
source_station_label =
ttk.Label(root, text="SOURCE
STATION",width="20")
source_station_label.pack()
source_station_combobox =
ttk.Combobox(root,
values=list(cities.keys()),width="
20")
source_station_combobox.pack(
)
source_station =
source_station_combobox.get()
# Destination Station
destination_station_label =
ttk.Label(root,
text="DESTINATION
STATION",width="20")
destination_station_label.pack()
destination_station_combobox =
ttk.Combobox(root,
values=list(cities.keys()),width="
20")
destination_station_combobox.p
ack()
destination_station =
destination_station_combobox.g
et()
# train type
Train_type_label =
ttk.Label(root, text="TRAIN
TYPE :",width="20")
Train_type_label.pack()
Train_type_combobox =
ttk.Combobox(root,
values=list(typ.keys()),width="20
")
Train_type_combobox.pack()
# Platform Number
platform_number_label =
ttk.Label(root,
text="PLATFORM",width="20")
platform_number_label.pack()
platform_number_entry =
ttk.Entry(root,width="20")
platform_number_entry.pack()
# Announcement Type
announcement_label =
ttk.Label(root,
text="ANNOUNCEMT
TYPE",width="20")
announcement_label.pack()
announcement_var =
tk.StringVar()
arrival_radio =
ttk.Radiobutton(root,
text="Arrival",
variable=announcement_var,
value="Arrival")
arrival_radio.pack()
departure_radio =
ttk.Radiobutton(root,
text="Departure",
variable=announcement_var,
value="Departure")
departure_radio.pack()
# times play
repeatation_label =
ttk.Label(root, text="REPEAT
FOR :",width="20")
repeatation_label.pack()
repeatation_entry =
ttk.Entry(root,width="20")
repeatation_entry.pack()
# Submit Button
submit_button = ttk.Button(root,
text="ANNOUCE",
command=submit)
submit_button.pack()
# exit button
exit_button = ttk.Button(root,
text="EXIT",command=root.destr
oy)
exit_button.pack()
root.mainloop()