예제 #1
0
def predictRoute():
    print('in plot')
    if request.method=='POST':
        print('if')
        try:
            image = request.json['sound']
            # print('image',image)
            print('image')
            decodeSound(image, "video.mp4")
            print('decodeSound')
            clip = mp.VideoFileClip("video.mp4")
            print('clip video')
            clip.audio.write_audiofile("audio123.wav")
            print('clip audio')
            result = speechToText.speech2Text("audio123.wav")
            print('result')
            summary=summ.summarize(result)
            print('sssssssummary',summary)
            result='<h4 style=color:#273582>ORIGINAL TEXT:</h4>'+result+'<br>'+'<h4 style=color:#273582>SUMMARIZED TEXT:</h4>'+summary
            return jsonify({"Result" : str(result)})
            # return render_template('results.html')
            # return render_template('results.html',result=result,summary=summary)

        except Exception as e:
            print('The Exception message is: ', e)
            return 'something is wrong'
예제 #2
0
def predictRoute():
    sound = request.json['sound']
    decodeSound(sound, "audio123.wav")
    result = speechToText.speech2Text("audio123.wav")
    return jsonify({"Result": str(result)})