reco small refactor
This commit is contained in:
parent
3f2663e803
commit
8e133c8f8e
19
src/reco.py
19
src/reco.py
@ -20,7 +20,6 @@ def main(args):
|
|||||||
batch_size = int(args.batch_size)
|
batch_size = int(args.batch_size)
|
||||||
waves = getWavList(col, batch_size)
|
waves = getWavList(col, batch_size)
|
||||||
uris = [w['gcsWawLocation'] for w in waves]
|
uris = [w['gcsWawLocation'] for w in waves]
|
||||||
print(uris)
|
|
||||||
|
|
||||||
start = time.perf_counter()
|
start = time.perf_counter()
|
||||||
with concurrent.futures.ThreadPoolExecutor(max_workers=64) as executor:
|
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]
|
storage_uri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# client = speech_v1.SpeechClient()
|
|
||||||
client = speech_v1p1beta1.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(
|
d_config = types.SpeakerDiarizationConfig(
|
||||||
enable_speaker_diarization=True
|
enable_speaker_diarization=True
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user