You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure Speech To Text连续识别:如何正确获取立体声音频通道信息?

关于Azure Speech To Text连续识别立体声声道信息获取的问题

我正在使用Azure Speech To Text - 连续识别功能转录音频文件,音频是分左、右声道的立体声WAV文件。但执行转录时无法正确获取声道信息:尝试通过PropertyId.SpeechServiceResponse_JsonResult获取通道值,该值始终返回0,而预期左声道返回0、右声道返回1。

初始化代码如下:

var speechConfig = SpeechConfig.FromSubscription(/*api key*/, /*region*/);
var audioConfig = AudioConfig.FromWavFileInput(filePath);
var recognizer = new SpeechRecognizer(speechConfig, audioConfig);

是否存在隐藏属性或缺失的配置来实现正确获取声道信息?

我尝试从JsonResult属性中获取通道的代码如下:

var speechServiceResponseJsonResultJson = eventArgs.Result.Properties.GetProperty(PropertyId.SpeechServiceResponse_JsonResult);

var channel = 0;
if (speechServiceResponseJsonResultJson != null)
{
    var speechServiceResponseJsonResult =
        JsonConvert.DeserializeObject<JObject>(
            eventArgs.Result.Properties.GetProperty(PropertyId
                .SpeechServiceResponse_JsonResult));

    if (speechServiceResponseJsonResult.TryGetValue("Channel", StringComparison.InvariantCultureIgnoreCase, out var channelValue))
    {
        channel = channelValue.ToObject<int>();
    }
}

内容的提问来源于stack exchange,提问作者Jakub Holovsky

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.05 13:42:17