Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-060
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
Chalika Mihiran
2021-060
Commits
b667e038
Commit
b667e038
authored
Jul 04, 2021
by
IT18126884
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Silence.py
parent
ed529e08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
Silence.py
Silence.py
+2
-2
No files found.
Silence.py
View file @
b667e038
...
...
@@ -4,7 +4,7 @@ from pydub import AudioSegment
from
pydub.silence
import
split_on_silence
sound
=
AudioSegment
.
from_wav
(
"C:/Users/Janitha Akalanka/PycharmProjects/English.wav"
)
chunks
=
split_on_silence
(
sound
,
min_silence_len
=
5
0
,
silence_thresh
=
sound
.
dBFS
-
16
,
keep_silence
=
150
)
chunks
=
split_on_silence
(
sound
,
min_silence_len
=
20
0
,
silence_thresh
=
sound
.
dBFS
-
16
,
keep_silence
=
150
)
chunk_folder_name
=
"C:/Users/Janitha Akalanka/PycharmProjects/splits_by_pauses"
...
...
@@ -16,4 +16,4 @@ for i, audio_chunk in enumerate(chunks, start=1):
chunk_file
=
os
.
path
.
join
(
chunk_folder_name
,
f
"chunk{i}.wav"
)
audio_chunk
.
export
(
chunk_file
,
format
=
"wav"
,
bitrate
=
'192k'
)
print
(
str
(
len
(
chunks
)
-
1
)
+
" : Pause/s found"
)
\ No newline at end of file
print
(
str
(
len
(
chunks
)
-
1
)
+
" : Silence/s found"
)
\ No newline at end of file
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