-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathContentVersioning.py
44 lines (35 loc) · 1.12 KB
/
ContentVersioning.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import apiaudio
import os
#define env variable: export apiaudio_key="AFLR_API_KEY" or add to your system
apiaudio.api_key = os.environ["AFLR_API_KEY"]
audience_params = [
{"band": "Nickelback", "city": "Berlin"},
{"band": "The Animals", "city": "Barcelona"},
{"band": "Coldplay", "city": "London"},
]
text = """
Great news for all {{band}} fans!
They have just added two new tour dates to their previously sold-out concert in {{city}}.
Head over to buytickets.com to grab your tickets before they sell out!
"""
script = apiaudio.Script.create(
scriptId="concert-ad",
scriptText=text,
scriptName="concert-ad"
)
for audience in audience_params:
speech = apiaudio.Speech.create(
scriptId="concert-ad",
voice="sonia",
audience=audience
)
mastering = apiaudio.Mastering.create(
scriptId="concert-ad",
soundTemplate="house",
audience=audience,
share=True
)
# Check the response
print('Response from mastering', mastering)
# Listen and share your audio file
print('Listen to your audio here', mastering['shareUrl'])