【问题标题】:Microsoft Speech to Text with non-ASCII file names具有非 ASCII 文件名的 Microsoft Speech to Text
【发布时间】:2021-04-19 09:03:05
【问题描述】:

我正在使用 Microsoft Speech API 和 https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/cpp/windows/console 的示例代码。 speech_recognition_samples.cpp 中的 SpeechContinuousRecognitionWithFile() 函数几乎完全是我所需要的。

修改这个函数,我将输入文件的名称替换为恰好在我磁盘上的另一个文件的名称,"Blutgefäße.wav"。这导致FromWavFileInput 调用中出现std::range_error 异常,只能通过将文件重命名为"Blutgefaesse.wav" 来修复。

这个函数的预期行为是否会因国际文件名而崩溃?我必须使用 API 的 Unicode 版本吗?如果有,我在哪里可以找到它?

【问题讨论】:

    标签: c++ unicode internationalization azure-cognitive-services


    【解决方案1】:

    解决方案是以 UTF-8 编码提供非 ASCII 文件名:

    u8"Blutgefäße.wav"

    顺便说一下,脚本也是 UTF-8 编码的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-03-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-03
      • 2021-01-31
      • 1970-01-01
      相关资源
      最近更新 更多