Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2020-101
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sachith Fernando
2020-101
Commits
c1e2b998
Commit
c1e2b998
authored
Nov 02, 2020
by
LiniEisha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reformatting speech_to_text.py
parent
82b58cef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
LectureSummarizingApp/speech_to_text.py
LectureSummarizingApp/speech_to_text.py
+3
-3
No files found.
LectureSummarizingApp/speech_to_text.py
View file @
c1e2b998
...
...
@@ -4,17 +4,17 @@ import os
def
speech_to_text
(
video_name
):
#calling the Recognizer()
r
=
sr
.
Recognizer
()
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
VIDEO_PATH
=
os
.
path
.
join
(
BASE_DIR
,
"lectures
\\
{}"
.
format
(
video_name
))
with
sr
.
AudioFile
(
VIDEO_PATH
)
as
source
:
audio
=
r
.
listen
(
source
)
file
=
open
(
'audioToText01.txt'
,
'w'
)
file
=
open
(
'audioToText01.txt'
,
'w'
)
#open file
try
:
text
=
r
.
recognize_google
(
audio
)
text
=
r
.
recognize_google
(
audio
)
#Convert using google recognizer
file
.
write
(
text
)
except
:
file
.
write
(
'error'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment