Spaces:
Runtime error
Runtime error
HyperMind-Labs
commited on
Commit
·
218b02b
1
Parent(s):
377ad2a
Updates
Browse files
app.py
CHANGED
@@ -52,6 +52,14 @@ with st.expander('About this App'):
|
|
52 |
wav_audio_data = st_audiorec()
|
53 |
if wav_audio_data is not None:
|
54 |
np_wav = np.frombuffer(wav_audio_data, dtype=np.int16)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
# wav_tensor = torch.tensor(np_wav, dtype=torch.float32)
|
56 |
# segment_samples = int(44100 * 1)
|
57 |
# num_segments = len(wav_tensor) // segment_samples
|
@@ -61,7 +69,7 @@ if wav_audio_data is not None:
|
|
61 |
# end_sample = (i + 1) * segment_samples
|
62 |
# segment = wav_tensor[start_sample:end_sample]
|
63 |
# segments_list.append(segment)
|
64 |
-
st.write(
|
65 |
# PERCENTAGE OF SNORING PLOT
|
66 |
|
67 |
|
|
|
52 |
wav_audio_data = st_audiorec()
|
53 |
if wav_audio_data is not None:
|
54 |
np_wav = np.frombuffer(wav_audio_data, dtype=np.int16)
|
55 |
+
num_segments = len(np_wav)//100000
|
56 |
+
segments_list = []
|
57 |
+
for i in range(num_segments):
|
58 |
+
start_sample = i * 100000
|
59 |
+
end_sample = (i + 1) * 100000
|
60 |
+
segment = np_wav[start_sample:end_sample]
|
61 |
+
segments_list.append(segment)
|
62 |
+
|
63 |
# wav_tensor = torch.tensor(np_wav, dtype=torch.float32)
|
64 |
# segment_samples = int(44100 * 1)
|
65 |
# num_segments = len(wav_tensor) // segment_samples
|
|
|
69 |
# end_sample = (i + 1) * segment_samples
|
70 |
# segment = wav_tensor[start_sample:end_sample]
|
71 |
# segments_list.append(segment)
|
72 |
+
st.write(segments_list)
|
73 |
# PERCENTAGE OF SNORING PLOT
|
74 |
|
75 |
|