使用 Python 获取从 Azure 语音到文本服务的审查词的时间戳

Get timestamps of censored words from Azure Speech to Text Services using Python

如何使用 Python 获取带有 Azure 语音到文本服务的音频文件中删减词(脏话)的偏移量和持续时间? 我可以看到转换后的文本中的脏话带有星号,并且与口语的长度相同。 我想获得说脏话的时间戳,以便我可以使用该信息采取行动,例如将音频静音。

您必须在识别中请求单词级时间戳。你可以通过这个答案找到方法:How to get Word Level Timestamps using Azure Speech to Text and the Python SDK?

一句话,你得用speech_config.request_word_level_timestamps()