import json
import os
from watson_developer_cloud import TextToSpeechV1

def getWatsonKeys():
    data = json.load(open('keys/ibmwatson.json', 'r'))
    return data["textToSpeech"][0]["credentials"]

class WatsonTextToSpeech:
    def __init__(self):
        keys = getWatsonKeys()
        self.service = TextToSpeechV1(url=keys['url'], iam_apikey=keys["apikey"])
    def getAudio(self, text):
        response = self.service.synthesize(text, accept='audio/wav', voice="en-US_AllisonVoice")
        return response
    def playAudio(self, text):
        with open('output.wav', 'wb') as audio_file:
            audio_file.write( getAudio(text))
        print('[Checkpoint] Speaking: ', tedt)
        os.system('play output.wav')

85f639c1b41b5e5fb0ca22657c6ed71cb069a70d
<mask token>


class WatsonTextToSpeech:
    <mask token>
    <mask token>

    def playAudio(self, text):
        with open('output.wav', 'wb') as audio_file:
            audio_file.write(getAudio(text))
        print('[Checkpoint] Speaking: ', tedt)
        os.system('play output.wav')

<mask token>


class WatsonTextToSpeech:

    def __init__(self):
        keys = getWatsonKeys()
        self.service = TextToSpeechV1(url=keys['url'], iam_apikey=keys[
            'apikey'])

    def getAudio(self, text):
        response = self.service.synthesize(text, accept='audio/wav', voice=
            'en-US_AllisonVoice')
        return response

    def playAudio(self, text):
        with open('output.wav', 'wb') as audio_file:
            audio_file.write(getAudio(text))
        print('[Checkpoint] Speaking: ', tedt)
        os.system('play output.wav')

<mask token>


def getWatsonKeys():
    data = json.load(open('keys/ibmwatson.json', 'r'))
    return data['textToSpeech'][0]['credentials']


class WatsonTextToSpeech:

    def __init__(self):
        keys = getWatsonKeys()
        self.service = TextToSpeechV1(url=keys['url'], iam_apikey=keys[
            'apikey'])

    def getAudio(self, text):
        response = self.service.synthesize(text, accept='audio/wav', voice=
            'en-US_AllisonVoice')
        return response

    def playAudio(self, text):
        with open('output.wav', 'wb') as audio_file:
            audio_file.write(getAudio(text))
        print('[Checkpoint] Speaking: ', tedt)
        os.system('play output.wav')

import json
import os
from watson_developer_cloud import TextToSpeechV1


def getWatsonKeys():
    data = json.load(open('keys/ibmwatson.json', 'r'))
    return data['textToSpeech'][0]['credentials']


class WatsonTextToSpeech:

    def __init__(self):
        keys = getWatsonKeys()
        self.service = TextToSpeechV1(url=keys['url'], iam_apikey=keys[
            'apikey'])

    def getAudio(self, text):
        response = self.service.synthesize(text, accept='audio/wav', voice=
            'en-US_AllisonVoice')
        return response

    def playAudio(self, text):
        with open('output.wav', 'wb') as audio_file:
            audio_file.write(getAudio(text))
        print('[Checkpoint] Speaking: ', tedt)
        os.system('play output.wav')

import json
import os
from watson_developer_cloud import TextToSpeechV1

def getWatsonKeys():
    data = json.load(open('keys/ibmwatson.json', 'r'))
    return data["textToSpeech"][0]["credentials"]

class WatsonTextToSpeech:
    def __init__(self):
        keys = getWatsonKeys()
        self.service = TextToSpeechV1(url=keys['url'], iam_apikey=keys["apikey"])
    def getAudio(self, text):
        response = self.service.synthesize(text, accept='audio/wav', voice="en-US_AllisonVoice")
        return response
    def playAudio(self, text):
        with open('output.wav', 'wb') as audio_file:
            audio_file.write( getAudio(text))
        print('[Checkpoint] Speaking: ', tedt)
        os.system('play output.wav')
