Spaces:
Runtime error
Runtime error
Emanuele Lapponi
commited on
Commit
Β·
bfe0bce
1
Parent(s):
8787890
initial
Browse files- app.py +35 -0
- requirements.txt +53 -0
app.py
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
import io
|
3 |
+
import soundfile as sf
|
4 |
+
import streamlit as st
|
5 |
+
from audio_recorder_streamlit import audio_recorder
|
6 |
+
|
7 |
+
import pedalboard as pb
|
8 |
+
|
9 |
+
st.title("πΉ Voice Refuckulator")
|
10 |
+
|
11 |
+
audio_bytes = audio_recorder()
|
12 |
+
board = pb.Pedalboard([pb.Reverb(room_size=0.100), pb.Gain(-10)])
|
13 |
+
|
14 |
+
if audio_bytes:
|
15 |
+
# data must be transposed, maybe before processing?
|
16 |
+
wave, sr = sf.read(io.BytesIO(audio_bytes))
|
17 |
+
effected = board(wave, sr, reset=False)
|
18 |
+
cols = st.columns(5)
|
19 |
+
stretch_factor = cols[0].slider("π§ Trollizer", 1, 32, 16)
|
20 |
+
chunk_factor = cols[1].slider("π Chunkinator", 1, 16, 8)
|
21 |
+
chunk_dividend = cols[2].slider("π« Dechunkizer", 1, 32, 16)
|
22 |
+
shuffle = cols[3].slider("π€‘ Impredictidiblize", 1, 32, 16)
|
23 |
+
sr_factor = cols[4].slider("πββοΈ Chirpidize", 1, 16, 8)
|
24 |
+
stretched = []
|
25 |
+
for chunk in np.array_split(effected, chunk_dividend):
|
26 |
+
for i in range(chunk_factor):
|
27 |
+
if i % shuffle == 0:
|
28 |
+
for c in chunk:
|
29 |
+
for _ in range(stretch_factor):
|
30 |
+
stretched.append(c)
|
31 |
+
else:
|
32 |
+
for c in chunk:
|
33 |
+
stretched.append(c)
|
34 |
+
stretched = np.array(stretched)
|
35 |
+
st.audio(stretched.T, sample_rate=sr*sr_factor)
|
requirements.txt
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
altair==4.2.2
|
2 |
+
attrs==22.2.0
|
3 |
+
audio-recorder-streamlit==0.0.8
|
4 |
+
blinker==1.5
|
5 |
+
cachetools==5.3.0
|
6 |
+
certifi @ file:///private/var/folders/sy/f16zz6x50xz3113nwtb9bvq00000gp/T/abs_477u68wvzm/croot/certifi_1671487773341/work/certifi
|
7 |
+
cffi==1.15.1
|
8 |
+
charset-normalizer==3.0.1
|
9 |
+
click==8.1.3
|
10 |
+
decorator==5.1.1
|
11 |
+
entrypoints==0.4
|
12 |
+
gitdb==4.0.10
|
13 |
+
GitPython==3.1.30
|
14 |
+
idna==3.4
|
15 |
+
importlib-metadata==6.0.0
|
16 |
+
install==1.3.5
|
17 |
+
Jinja2==3.1.2
|
18 |
+
jsonschema==4.17.3
|
19 |
+
markdown-it-py==2.1.0
|
20 |
+
MarkupSafe==2.1.2
|
21 |
+
mdurl==0.1.2
|
22 |
+
numpy==1.24.2
|
23 |
+
packaging==23.0
|
24 |
+
pandas==1.5.3
|
25 |
+
pedalboard==0.6.9
|
26 |
+
Pillow==9.4.0
|
27 |
+
playsound==1.3.0
|
28 |
+
protobuf==3.20.3
|
29 |
+
pyarrow==11.0.0
|
30 |
+
pycparser==2.21
|
31 |
+
pydeck==0.8.0
|
32 |
+
Pygments==2.14.0
|
33 |
+
Pympler==1.0.1
|
34 |
+
pyrsistent==0.19.3
|
35 |
+
python-dateutil==2.8.2
|
36 |
+
pytz==2022.7.1
|
37 |
+
pytz-deprecation-shim==0.1.0.post0
|
38 |
+
requests==2.28.2
|
39 |
+
rich==13.3.1
|
40 |
+
semver==2.13.0
|
41 |
+
six==1.16.0
|
42 |
+
smmap==5.0.0
|
43 |
+
soundfile==0.11.0
|
44 |
+
streamlit==1.17.0
|
45 |
+
toml==0.10.2
|
46 |
+
toolz==0.12.0
|
47 |
+
tornado==6.2
|
48 |
+
typing_extensions==4.4.0
|
49 |
+
tzdata==2022.7
|
50 |
+
tzlocal==4.2
|
51 |
+
urllib3==1.26.14
|
52 |
+
validators==0.20.0
|
53 |
+
zipp==3.12.1
|