def test_main(resource, capsys, cloud_config): # Run the transcribe sample on audio.raw, verify correct results storage_uri = 'gs://{}/speech/audio.raw'.format( cloud_config.storage_bucket) main(storage_uri, 'LINEAR16', 16000) out, err = capsys.readouterr() assert re.search(r'how old is the Brooklyn Bridge', out, re.DOTALL | re.I)
def selectCall(phoneNum): audio_play = playaudio() listofbuckets = [] masterInfoList = [] for obj in bucket.objects.all(): call = obj.key.split("/") if (call[0] == phoneNum): listofbuckets.append((obj.key, call[1])) formDate = getDateForm() formDate.dateGiven.choices = listofbuckets if formDate.is_submitted() or audio_play.is_submitted(): result = request.form filename = result["dateGiven"] fileNum = str(filename.split("/")[0]) fileDate = str(filename.split("/")[1]) fileWAV = str(filename.split("/")[-1]) transcript = transcribe.main(fileNum, fileDate, fileWAV) #play=False #if audio_play.is_submitted(): #play = get_audio(filename,fileWAV) audio_name = 'https://crmcustomeraudio.s3.amazonaws.com/' + filename #audio_path = 'static/'+fileWAV return render_template("transcription.html", transcript=transcript, audio_name=audio_name) return render_template('giveDates.html', phoneNum=phoneNum, form=formDate, listofbuckets=listofbuckets)
def test_main(resource, capsys): main(resource('audio.raw')) out, err = capsys.readouterr() assert re.search(r'how old is the Brooklyn Bridge', out, re.DOTALL | re.I)
def speech2text (file): return transcribe.main(file)
import wave, struct from transcribe import main waveFile = wave.open('recordings/0001.wav', 'r') main(waveFile)
def detected_callback(): print("hotword detected") # call(["python", "/home/pi/newThomasTest/Snowboy/transcribe.py"]) main()
def test_main(capsys): main(os.path.join(RESOURCES, 'audio.raw')) out, err = capsys.readouterr() assert re.search(r'how old is the Brooklyn Bridge', out, re.DOTALL | re.I)