标签: diarization

高效的说话人分类

我正在谷歌云上运行一个虚拟机实例。我的目标是将说话人分类应用于存储在云存储桶上的多个 .wav 文件。

我尝试了以下替代方案来解决后续问题:

  1. Google API 上的说话人分类。这似乎进行得很快,但结果却毫无意义。我已经见过类似的问题,我自己打开了一个线程,但没有得到答案......这个输出最多只返回两个带有随机标签的扬声器。这是我在 python 中尝试过的代码:
from google.cloud import speech_v1p1beta1 as speech
from google.cloud import storage
import os
import json
import sys

storage_client = storage.Client()
client = speech.SpeechClient()


if "--channel" in sys.argv:
    index = sys.argv.index("--channel") + 1
    if index < len(sys.argv):
        channel = sys.argv[index]
        print("Channel:", channel)
    else:
        print("--channel option requires a value")


audio_folder=f'audio_{channel}'
# channel='tve'
transcript_folder=f'transcript_output'

bucket = storage_client.bucket(audio_folder)
bucket2 = storage_client.bucket(transcript_folder)
wav_files=[i.name for i in bucket.list_blobs()]
json_files=[i.name.split(f'{channel}/')[-1] for i in bucket2.list_blobs(prefix=channel)]



for file in …
Run Code Online (Sandbox Code Playgroud)

python speech-to-text google-cloud-platform diarization

5
推荐指数
1
解决办法
2249
查看次数