Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- r = requests.get("https://api.streamelements.com/kappa/v2/speech?voice=%s&text=%s" % (voice_id, msg))
- if r.status_code == 200:
- frame_rate_index = utils.clamp(frame_rate_index, 0, len(g.rates) - 1)
- frame_rate = g.rates[frame_rate_index]
- sound = AudioSegment.from_file(io.BytesIO(r.content), format="mp3")
- sound = sound.set_frame_rate(44100)
- sound.frame_rate = frame_rate
- sound = utils.match_target_amplitude(sound, -15)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement