from pathlib import Path
from typing import Optional
import streamlit as st
import streamlit.components.v1 as components
# Tell streamlit that there is a component called audio2text,
# and that the code to display that component is in the "frontend" folder
frontend_dir = (Path(__file__).parent / "frontend").absolute()
_component_func = components.declare_component(
"audio2text", path=str(frontend_dir)
)
# Create the python function that will be called
def audio2text():
"""
Add a descriptive docstring
"""
_component_func()
def main():
# st.set_page_config()
st.write("## Offline real-time speech-to-text")
audio2text()
if __name__ == "__main__":
main()
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.