Spaces:
Running
Running
poemsforaphrodite
commited on
Commit
•
effda71
1
Parent(s):
8cb17aa
Update openvoice_app.py
Browse files- openvoice_app.py +5 -4
openvoice_app.py
CHANGED
@@ -6,6 +6,7 @@ from mailersend import emails
|
|
6 |
from dotenv import load_dotenv
|
7 |
from elevenlabs.client import ElevenLabs
|
8 |
from elevenlabs import play, save
|
|
|
9 |
|
10 |
# Load environment variables
|
11 |
load_dotenv()
|
@@ -23,8 +24,8 @@ os.makedirs(output_dir, exist_ok=True)
|
|
23 |
|
24 |
supported_languages = ['zh', 'en']
|
25 |
|
26 |
-
MAILERSEND_API_KEY =
|
27 |
-
MAILERSEND_DOMAIN =
|
28 |
MAILERSEND_SENDER_EMAIL = f"noreply@{MAILERSEND_DOMAIN}"
|
29 |
MAILERSEND_SENDER_NAME = "Voice Clone App"
|
30 |
|
@@ -52,7 +53,7 @@ def send_email_with_file(recipient_email, file_path, subject, body):
|
|
52 |
mailer.set_plaintext_content(body, mail_body)
|
53 |
|
54 |
with open(file_path, "rb") as file:
|
55 |
-
attachment_content = file.read()
|
56 |
|
57 |
attachments = [
|
58 |
{
|
@@ -151,4 +152,4 @@ footer {visibility: hidden}
|
|
151 |
audio .btn-container {display: none}
|
152 |
"""
|
153 |
|
154 |
-
demo.add_css(css)
|
|
|
6 |
from dotenv import load_dotenv
|
7 |
from elevenlabs.client import ElevenLabs
|
8 |
from elevenlabs import play, save
|
9 |
+
import base64
|
10 |
|
11 |
# Load environment variables
|
12 |
load_dotenv()
|
|
|
24 |
|
25 |
supported_languages = ['zh', 'en']
|
26 |
|
27 |
+
MAILERSEND_API_KEY = os.getenv("MAILERSEND_API_KEY")
|
28 |
+
MAILERSEND_DOMAIN = os.getenv("MAILERSEND_DOMAIN")
|
29 |
MAILERSEND_SENDER_EMAIL = f"noreply@{MAILERSEND_DOMAIN}"
|
30 |
MAILERSEND_SENDER_NAME = "Voice Clone App"
|
31 |
|
|
|
53 |
mailer.set_plaintext_content(body, mail_body)
|
54 |
|
55 |
with open(file_path, "rb") as file:
|
56 |
+
attachment_content = base64.b64encode(file.read()).decode('utf-8')
|
57 |
|
58 |
attachments = [
|
59 |
{
|
|
|
152 |
audio .btn-container {display: none}
|
153 |
"""
|
154 |
|
155 |
+
demo.add_css(css)
|