Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Smart E- Learn Tracer
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
1
Merge Requests
1
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
23_22 - J 01
Smart E- Learn Tracer
Commits
fd102e22
Commit
fd102e22
authored
Jan 31, 2023
by
Niyas Inshaf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
cbb7209a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
out side voice/untitled16.py
out side voice/untitled16.py
+77
-0
No files found.
out side voice/untitled16.py
0 → 100644
View file @
fd102e22
# -*- coding: utf-8 -*-
"""Untitled16.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1YZOFDlzEhI9HUk0TBJ3M5opmNvLCqb8x
"""
# Commented out IPython magic to ensure Python compatibility.
# %load_ext autoreload
# %autoreload 2
#%env CUDA_VISIBLE_DEVICES=3
colab_requirements
=
[
"pip install librosa"
,
"pip install noisereduce"
,
"pip install soundfile"
,
]
import
sys
,
subprocess
def
run_subprocess_command
(
cmd
):
# run the command
process
=
subprocess
.
Popen
(
cmd
.
split
(),
stdout
=
subprocess
.
PIPE
)
# print the output
for
line
in
process
.
stdout
:
print
(
line
.
decode
()
.
strip
())
IN_COLAB
=
"google.colab"
in
sys
.
modules
if
IN_COLAB
:
for
i
in
colab_requirements
:
run_subprocess_command
(
i
)
# Commented out IPython magic to ensure Python compatibility.
import
IPython
from
scipy.io
import
wavfile
import
noisereduce
as
nr
import
soundfile
as
sf
from
noisereduce.generate_noise
import
band_limited_noise
import
matplotlib.pyplot
as
plt
import
urllib.request
import
numpy
as
np
import
io
# %matplotlib inline
url
=
"https://raw.githubusercontent.com/timsainb/noisereduce/master/assets/fish.wav"
response
=
urllib
.
request
.
urlopen
(
url
)
data
,
rate
=
sf
.
read
(
io
.
BytesIO
(
response
.
read
()))
data
=
data
IPython
.
display
.
Audio
(
data
=
data
,
rate
=
rate
)
fig
,
ax
=
plt
.
subplots
(
figsize
=
(
20
,
3
))
ax
.
plot
(
data
)
noise_len
=
2
# seconds
noise
=
band_limited_noise
(
min_freq
=
2000
,
max_freq
=
12000
,
samples
=
len
(
data
),
samplerate
=
rate
)
*
10
noise_clip
=
noise
[:
rate
*
noise_len
]
audio_clip_band_limited
=
data
+
noise
fig
,
ax
=
plt
.
subplots
(
figsize
=
(
20
,
3
))
ax
.
plot
(
audio_clip_band_limited
)
IPython
.
display
.
Audio
(
data
=
audio_clip_band_limited
,
rate
=
rate
)
reduced_noise
=
nr
.
reduce_noise
(
y
=
audio_clip_band_limited
,
sr
=
rate
,
n_std_thresh_stationary
=
1.5
,
stationary
=
True
)
fig
,
ax
=
plt
.
subplots
(
figsize
=
(
20
,
3
))
ax
.
plot
(
reduced_noise
)
IPython
.
display
.
Audio
(
data
=
reduced_noise
,
rate
=
rate
)
\ 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