Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,14 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
import numpy as np
|
| 3 |
import scipy.io.wavfile as wavfile
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
# Morse code dictionary
|
| 6 |
MORSE_CODE_DICT = {
|
|
@@ -69,7 +77,7 @@ def convert_to_morse_and_audio(input_text, frequency, wpm):
|
|
| 69 |
return morse_text, audio_file
|
| 70 |
|
| 71 |
# Gradio Blocks UI
|
| 72 |
-
with gr.Blocks(title="Text to Morse Code Audio Converter") as demo:
|
| 73 |
gr.Markdown("# Text to Morse Code Audio Converter")
|
| 74 |
gr.Markdown("Enter text to convert it to Morse code and generate an audio file.")
|
| 75 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
import numpy as np
|
| 4 |
import scipy.io.wavfile as wavfile
|
| 5 |
+
# Base directory setup
|
| 6 |
+
BASE_DIR = os.getcwd()
|
| 7 |
+
|
| 8 |
+
DEFAULT_FONT_PATH = f"{BASE_DIR}/fonts/Vipnagorgialla Bd.otf"
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
|
| 12 |
|
| 13 |
# Morse code dictionary
|
| 14 |
MORSE_CODE_DICT = {
|
|
|
|
| 77 |
return morse_text, audio_file
|
| 78 |
|
| 79 |
# Gradio Blocks UI
|
| 80 |
+
with gr.Blocks(title="Text to Morse Code Audio Converter", css="footer{display:none !important}", theme=gr.themes.Soft(primary_hue="sky", secondary_hue="blue", spacing_size="sm", radius_size="lg", font=DEFAULT_FONT_PATH)) as demo:
|
| 81 |
gr.Markdown("# Text to Morse Code Audio Converter")
|
| 82 |
gr.Markdown("Enter text to convert it to Morse code and generate an audio file.")
|
| 83 |
|