Spaces:
Build error
Build error
Download pages/common.py from ulas742/spatial-audio-study: direct link, hf CLI and curl.
- Browser
- Download file 707 Bytes
-
https://huggingface.co/spaces/ulas742/spatial-audio-study/resolve/main/pages/common.py
- Command line
-
hf download hf://spaces/ulas742/spatial-audio-study/pages/common.py
-
curl -L -o common.py https://huggingface.co/spaces/ulas742/spatial-audio-study/resolve/main/pages/common.py
707 Bytes
| import uuid | |
| import streamlit as st | |
| from streamlit_extras.switch_page_button import switch_page | |
| # hide sidebar | |
| def hide_sidebar(): | |
| st.set_page_config(initial_sidebar_state="collapsed") | |
| st.markdown( | |
| """ | |
| <style> | |
| [data-testid="stSidebarCollapsedControl"] { | |
| display: none | |
| } | |
| </style> | |
| """, | |
| unsafe_allow_html=True, | |
| ) | |
| # Define a function to move to the next page | |
| pages = {2: "headphones", 3: "hrtf_selection", 4: "questions"} | |
| def next_page(): | |
| st.session_state.page += 1 | |
| switch_page(pages.get(st.session_state.page, "final")) | |
| def get_new_ref(): | |
| return str(uuid.uuid4()).upper().split("-")[0] | |
| AUDIO_PATH = "assets/snare4.wav" | |