fardaabc commited on
Commit
4d273f8
·
verified ·
1 Parent(s): 5225d6d

Update APP.PY

Browse files
Files changed (1) hide show
  1. APP.PY +17 -41
APP.PY CHANGED
@@ -1,59 +1,35 @@
1
  import gradio as gr
2
 
3
-
4
- def placeholder_generate(text, acting_prompt):
5
  if not text.strip():
6
- return " No text provided."
7
-
8
- return (
9
- "✅ UI Skeleton is working.\n\n"
10
- f"Text length: {len(text)} characters\n"
11
- f"Acting prompt received: {bool(acting_prompt.strip())}\n\n"
12
- "Next step: connect audio engine."
13
- )
14
 
 
15
 
16
- with gr.Blocks(title="FardaVoice") as demo:
17
- gr.Markdown(
18
- """
19
- ## 🎙️ FardaVoice
20
- **Acting-based Text-to-Speech (Experimental)**
21
 
22
- - One voice
23
- - One acting prompt
24
- - No censorship
25
- - Prompt = Acting
26
- """
27
  )
28
 
29
  text_input = gr.Textbox(
30
- label="Text to Read",
31
- placeholder="متنی که باید خوانده شود را اینجا بنویس...",
32
  lines=6
33
  )
34
 
35
- acting_prompt = gr.Textbox(
36
- label="Acting Prompt",
37
- placeholder=(
38
- "مثال:\n"
39
- "Start calm, become angry in the middle, "
40
- "end with a soft laugh"
41
- ),
42
- lines=5
43
- )
44
 
45
- generate_btn = gr.Button("Generate (Skeleton Test)")
46
-
47
- status_output = gr.Textbox(
48
- label="Status",
49
- interactive=False
50
- )
51
 
52
  generate_btn.click(
53
- fn=placeholder_generate,
54
- inputs=[text_input, acting_prompt],
55
- outputs=status_output
56
  )
57
 
58
  demo.launch()
59
-
 
1
  import gradio as gr
2
 
3
+ def generate_audio(prompt, text):
 
4
  if not text.strip():
5
+ return "Text is empty."
 
 
 
 
 
 
 
6
 
7
+ return f"ACTING PROMPT:\n{prompt}\n\nTEXT:\n{text}"
8
 
9
+ with gr.Blocks() as demo:
10
+ gr.Markdown("## 🎙️ FardaVoice – Acting Prompt TTS (Skeleton)")
 
 
 
11
 
12
+ acting_prompt = gr.Textbox(
13
+ label="🎭 Acting Prompt (Emotion + Style)",
14
+ placeholder="e.g. Speak slowly, deep sad voice, slight trembling, cinematic tone...",
15
+ lines=4
 
16
  )
17
 
18
  text_input = gr.Textbox(
19
+ label="📝 Text to Perform",
20
+ placeholder="Enter the text that should be acted...",
21
  lines=6
22
  )
23
 
24
+ output = gr.Textbox(label="Output (Temporary)")
 
 
 
 
 
 
 
 
25
 
26
+ generate_btn = gr.Button("Generate (Skeleton)")
 
 
 
 
 
27
 
28
  generate_btn.click(
29
+ fn=generate_audio,
30
+ inputs=[acting_prompt, text_input],
31
+ outputs=output
32
  )
33
 
34
  demo.launch()
35
+