reco small refactor

This commit is contained in:
Wojciech Smolak 2020-08-20 20:28:00 +02:00
parent 3f2663e803
commit 8e133c8f8e

View File

@ -20,7 +20,6 @@ def main(args):
batch_size = int(args.batch_size)
waves = getWavList(col, batch_size)
uris = [w['gcsWawLocation'] for w in waves]
print(uris)
start = time.perf_counter()
with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor:
@ -64,26 +63,8 @@ def recognize(storage_uri):
storage_uri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE]
"""
# client = speech_v1.SpeechClient()
client = speech_v1p1beta1.SpeechClient()
# storage_uri = 'gs://cloud-samples-data/speech/brooklyn_bridge.raw'
# Sample rate in Hertz of the audio data sent
sample_rate_hertz = 44100
# The language of the supplied audio
language_code = "pl-PL"
# Encoding of audio data sent. This sample sets this explicitly.
# This field is optional for FLAC and WAV audio formats.
encoding = enums.RecognitionConfig.AudioEncoding.LINEAR16
enable_speaker_diarization = True
# config = {
# "sample_rate_hertz": sample_rate_hertz,
# "language_code": language_code,
# "encoding": encoding,
# "enableSpeakerDiarization": enable_speaker_diarization
#
d_config = types.SpeakerDiarizationConfig(
enable_speaker_diarization=True
)