awacke1 commited on
Commit
75643c7
Β·
verified Β·
1 Parent(s): 69e0709

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -38
app.py CHANGED
@@ -4,9 +4,9 @@ import streamlit as st
4
  st.title("πŸ“‹ Library Demo Checklist")
5
  st.write("Check off each demo as you try these witty one-liners from our galaxy of libraries!")
6
 
7
- # 🌟 Session state to track checklist
8
  if 'checklist' not in st.session_state:
9
- st.session_state['checklist'] = {i: False for i in range(1, 41)} # 40 demos total
10
 
11
  # πŸ“œ PDF Libraries Section
12
  with st.expander("πŸ“œ PDF Libraries", expanded=True):
@@ -245,71 +245,57 @@ with st.expander("🎡 Audio Capture Libraries", expanded=True):
245
  on_change=lambda: st.session_state['checklist'].update({31: not st.session_state['checklist'][31]}))
246
  st.code("pydub.AudioSegment.from_file('audio.wav').export('out.wav')")
247
 
248
- # 32. pyaudio
249
- st.checkbox("32. pyaudio - Grabs sound bites faster than a parrot snagging crackers!",
250
  key="check_32",
251
  value=st.session_state['checklist'][32],
252
  on_change=lambda: st.session_state['checklist'].update({32: not st.session_state['checklist'][32]}))
253
- st.code("pyaudio.PyAudio().open().read(1024)")
254
 
255
- # 33. sounddevice
256
- st.checkbox("33. sounddevice - Snags audio smoother than a whisper in a quiet cave!",
257
  key="check_33",
258
  value=st.session_state['checklist'][33],
259
  on_change=lambda: st.session_state['checklist'].update({33: not st.session_state['checklist'][33]}))
260
- st.code("sounddevice.rec(44100).tobytes()")
261
 
262
- # 34. soundfile
263
- st.checkbox("34. soundfile - Saves sound like a librarian archiving whispers!",
264
  key="check_34",
265
  value=st.session_state['checklist'][34],
266
  on_change=lambda: st.session_state['checklist'].update({34: not st.session_state['checklist'][34]}))
267
- st.code("soundfile.write('out.wav', data, 44100)")
268
 
269
- # 35. pyaudioanalysis
270
- st.checkbox("35. pyaudioanalysis - Analyzes audio like a detective cracking a sonic mystery!",
271
  key="check_35",
272
  value=st.session_state['checklist'][35],
273
  on_change=lambda: st.session_state['checklist'].update({35: not st.session_state['checklist'][35]}))
274
- st.code("pyAudioAnalysis.audioBasicIO.read_audio_file('audio.wav')[1]")
275
 
276
- # 36. pyo
277
- st.checkbox("36. pyo - Spins audio magic like a wizard mixing potions!",
278
  key="check_36",
279
  value=st.session_state['checklist'][36],
280
  on_change=lambda: st.session_state['checklist'].update({36: not st.session_state['checklist'][36]}))
281
- st.code("pyo.Server().boot().start()")
282
 
283
- # 37. speechrecognition
284
- st.checkbox("37. speechrecognition - Hears you like a nosy neighbor with super ears!",
285
  key="check_37",
286
  value=st.session_state['checklist'][37],
287
  on_change=lambda: st.session_state['checklist'].update({37: not st.session_state['checklist'][37]}))
288
- st.code("speech_recognition.Recognizer().listen(speech_recognition.Microphone())")
289
 
290
- # 38. pyalsaaudio
291
- st.checkbox("38. pyalsaaudio - Grabs Linux sound like a penguin snagging fish!",
292
  key="check_38",
293
  value=st.session_state['checklist'][38],
294
  on_change=lambda: st.session_state['checklist'].update({38: not st.session_state['checklist'][38]}))
295
- st.code("pyalsa.alsaaudio.PCM().read()[1]")
296
-
297
- # 39. soundcard
298
- st.checkbox("39. soundcard - Captures sound like a bard strumming a silent lute!",
299
- key="check_39",
300
- value=st.session_state['checklist'][39],
301
- on_change=lambda: st.session_state['checklist'].update({39: not st.session_state['checklist'][39]}))
302
- st.code("soundcard.default_microphone().record(44100, 1)")
303
-
304
- # 40. webrtcvad
305
- st.checkbox("40. webrtcvad - Detects voices like a spy eavesdropping on a whisper party!",
306
- key="check_40",
307
- value=st.session_state['checklist'][40],
308
- on_change=lambda: st.session_state['checklist'].update({40: not st.session_state['checklist'][40]}))
309
  st.code("webrtcvad.Vad().is_speech(audio_frame, 16000)")
310
 
311
  # πŸ“Š Progress Tracker
312
  st.write("### Progress Tracker")
313
  completed = sum(1 for v in st.session_state['checklist'].values() if v)
314
- st.progress(completed / 40)
315
- st.write(f"{completed} out of 40 demos checked off!")
 
4
  st.title("πŸ“‹ Library Demo Checklist")
5
  st.write("Check off each demo as you try these witty one-liners from our galaxy of libraries!")
6
 
7
+ # 🌟 Session state to track checklist (38 items after removing pyaudio and pyalsaaudio)
8
  if 'checklist' not in st.session_state:
9
+ st.session_state['checklist'] = {i: False for i in range(1, 39)} # Adjusted to 38 demos
10
 
11
  # πŸ“œ PDF Libraries Section
12
  with st.expander("πŸ“œ PDF Libraries", expanded=True):
 
245
  on_change=lambda: st.session_state['checklist'].update({31: not st.session_state['checklist'][31]}))
246
  st.code("pydub.AudioSegment.from_file('audio.wav').export('out.wav')")
247
 
248
+ # 32. sounddevice
249
+ st.checkbox("32. sounddevice - Snags audio smoother than a whisper in a quiet cave!",
250
  key="check_32",
251
  value=st.session_state['checklist'][32],
252
  on_change=lambda: st.session_state['checklist'].update({32: not st.session_state['checklist'][32]}))
253
+ st.code("sounddevice.rec(44100).tobytes()")
254
 
255
+ # 33. soundfile
256
+ st.checkbox("33. soundfile - Saves sound like a librarian archiving whispers!",
257
  key="check_33",
258
  value=st.session_state['checklist'][33],
259
  on_change=lambda: st.session_state['checklist'].update({33: not st.session_state['checklist'][33]}))
260
+ st.code("soundfile.write('out.wav', data, 44100)")
261
 
262
+ # 34. pyaudioanalysis
263
+ st.checkbox("34. pyaudioanalysis - Analyzes audio like a detective cracking a sonic mystery!",
264
  key="check_34",
265
  value=st.session_state['checklist'][34],
266
  on_change=lambda: st.session_state['checklist'].update({34: not st.session_state['checklist'][34]}))
267
+ st.code("pyAudioAnalysis.audioBasicIO.read_audio_file('audio.wav')[1]")
268
 
269
+ # 35. pyo
270
+ st.checkbox("35. pyo - Spins audio magic like a wizard mixing potions!",
271
  key="check_35",
272
  value=st.session_state['checklist'][35],
273
  on_change=lambda: st.session_state['checklist'].update({35: not st.session_state['checklist'][35]}))
274
+ st.code("pyo.Server().boot().start()")
275
 
276
+ # 36. speechrecognition
277
+ st.checkbox("36. speechrecognition - Hears you like a nosy neighbor with super ears!",
278
  key="check_36",
279
  value=st.session_state['checklist'][36],
280
  on_change=lambda: st.session_state['checklist'].update({36: not st.session_state['checklist'][36]}))
281
+ st.code("speech_recognition.Recognizer().listen(speech_recognition.Microphone())")
282
 
283
+ # 37. soundcard
284
+ st.checkbox("37. soundcard - Captures sound like a bard strumming a silent lute!",
285
  key="check_37",
286
  value=st.session_state['checklist'][37],
287
  on_change=lambda: st.session_state['checklist'].update({37: not st.session_state['checklist'][37]}))
288
+ st.code("soundcard.default_microphone().record(44100, 1)")
289
 
290
+ # 38. webrtcvad
291
+ st.checkbox("38. webrtcvad - Detects voices like a spy eavesdropping on a whisper party!",
292
  key="check_38",
293
  value=st.session_state['checklist'][38],
294
  on_change=lambda: st.session_state['checklist'].update({38: not st.session_state['checklist'][38]}))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
295
  st.code("webrtcvad.Vad().is_speech(audio_frame, 16000)")
296
 
297
  # πŸ“Š Progress Tracker
298
  st.write("### Progress Tracker")
299
  completed = sum(1 for v in st.session_state['checklist'].values() if v)
300
+ st.progress(completed / 38) # Adjusted to 38 demos
301
+ st.write(f"{completed} out of 38 demos checked off!")