当前位置: 首页 > article >正文

Unity数字人开发笔记——讯飞超拟人语音

基于上一篇:
https://blog.csdn.net/qq_17523181/article/details/148255809?spm=1001.2014.3001.5501
https://blog.csdn.net/qq_17523181/article/details/148264127?spm=1011.2415.3001.5331

讯飞默认的语音非常机械,更换为讯飞的超拟人语音

一、讯飞API

在这里插入图片描述

WebApi : wss://cbm01.cn-huabei-1.xf-yun.com/v1/private/mcd9m97e6

API地址:https://www.xfyun.cn/doc/spark/super%20smart-tts.html

  • 示例
    在这里插入图片描述

二、Unity编写连接脚本

注意1:超拟人语音是属于大模型版块,所以它的鉴权是大模型的鉴权逻辑
注意2:示例python使用的encoding是lame,在unity需要使用raw

  • 建立XunfeiSmartTextToSpeech.cs文件
using System;
using System.Collections;
using System.Collections.Generic;
using System.Net.WebSockets;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using UnityEngine;public class XunfeiSmartTextToSpeech : TTS
{#region 参数/// <summary>/// 讯飞的应用设置/// </summary>[SerializeField]private XunfeiSettings m_XunfeiSettings;/// <summary>/// host地址/// </summary>[SerializeField] private string m_HostUrl = "cbm01.cn-huabei-1.xf-yun.com";/// <summary>/// 发音人/// </summary>[Header("选择朗读的声音")][SerializeField] private Speaker m_Vcn = Speaker.聆佑佑_童年女声;/// <summary>/// 音量,可选值:[0-100],默认为50/// </summary>[SerializeField] private int m_Volume = 50;/// <summary>/// 语音高,可选值:[0-100],默认为50/// </summary>[SerializeField] private int m_Pitch = 50;/// <summary>/// 语速,可选值:[0-100],默认为50/// </summary>[SerializeField] private int m_Speed = 50;#endregionprivate void Awake(){m_XunfeiSettings = this.GetComponent<XunfeiSettings>();m_PostURL= "wss://cbm01.cn-huabei-1.xf-yun.com/v1/private/mcd9m97e6";}/// <summary>/// 语音合成,返回合成文本/// </summary>/// <param name="_msg"></param>/// <param name="_callback"></param>public override void Speak(string _msg, Action<AudioClip, string> _callback){StartCoroutine(GetSpeech(_msg, _callback));}/// <summary>/// websocket/// </summary>private ClientWebSocket m_WebSocket;private CancellationToken m_CancellationToken;private AudioClip _audioClip;#region 获取鉴权Url/// <summary>/// 获取鉴权url/// </summary>/// <returns></returns>private string GetAuthUrl(){string date = DateTime.UtcNow.ToString("r");Uri uri = new Uri(m_PostURL);Debug.Log(uri);StringBuilder builder = new StringBuilder("host: ").Append(uri.Host).Append("\n").//Append("date: ").Append(date).Append("\n").//Append("GET ").Append(uri.LocalPath).Append(" HTTP/1.1");string sha = HMACsha256(m_XunfeiSettings.m_APISecret, builder.ToString());string authorization = string.Format("api_key=\"{0}\", algorithm=\"{1}\", headers=\"{2}\", signature=\"{3}\"", m_XunfeiSettings.m_APIKey, "hmac-sha256", "host date request-line", sha);string NewUrl = "wss://" + uri.Host + uri.LocalPath;string path1 = "authorization" + "=" + Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(authorization));date = date.Replace(" ", "%20").Replace(":", "%3A").Replace(",", "%2C");string path2 = "date" + "=" + date;string path3 = "host" + "=" + uri.Host;NewUrl = NewUrl + "?" + path1 + "&" + path2 + "&" + path3;Debug.Log("NewUrl");Debug.Log(NewUrl);return NewUrl;}public string HMACsha256(string apiSecretIsKey, string buider){byte[] bytes = System.Text.Encoding.UTF8.GetBytes(apiSecretIsKey);System.Security.Cryptography.HMACSHA256 hMACSHA256 = new System.Security.Cryptography.HMACSHA256(bytes);byte[] date = System.Text.Encoding.UTF8.GetBytes(buider);date = hMACSHA256.ComputeHash(date);hMACSHA256.Clear();return Convert.ToBase64String(date);}#endregion#region 语音合成/// <summary>/// 音频长度/// </summary>private int m_AudioLenth;/// <summary>/// 数据队列/// </summary>Queue<float> m_AudioQueue = new Queue<float>();/// <summary>/// 获取语音合成/// </summary>/// <param name="_text"></param>/// <param name="_callback"></param>/// <returns></returns>public IEnumerator GetSpeech(string _text, Action<AudioClip, string> _callback){stopwatch.Restart();yield return null;if (m_WebSocket != null) { m_WebSocket.Abort(); }ConnectHost(_text);_audioClip = AudioClip.Create("audio", 16000 * 60, 1, 16000, true, OnAudioRead);//回调_callback(_audioClip, _text);stopwatch.Stop();UnityEngine.Debug.Log("讯飞超拟人语音合成耗时:" + stopwatch.Elapsed.TotalSeconds);}void OnAudioRead(float[] data){for (int i = 0; i < data.Length; i++){if (m_AudioQueue.Count > 0){data[i] = m_AudioQueue.Dequeue();}else{if (m_WebSocket == null || m_WebSocket.State != WebSocketState.Aborted) m_AudioLenth++;data[i] = 0;}}}/// <summary>/// 连接服务器,合成语音/// </summary>private async void ConnectHost(string text){try{//text = "你好啊,你是谁呀,一起来玩吧";m_WebSocket = new ClientWebSocket();m_CancellationToken = new CancellationToken();Uri uri = new Uri(GetAuthUrl());Debug.Log(uri);await m_WebSocket.ConnectAsync(uri, m_CancellationToken);text = Convert.ToBase64String(Encoding.UTF8.GetBytes(text));//发送的数据string _jsonData = TTSRequestBuilder.BuildTTSRequest(appId: m_XunfeiSettings.m_AppID,headerStatus: 2,vcn: GetVcn(m_Vcn),volume: m_Volume,speed: m_Speed,pitch: m_Pitch,payloadStatus: 2,payloadText: text);await m_WebSocket.SendAsync(new ArraySegment<byte>(Encoding.UTF8.GetBytes(_jsonData)), WebSocketMessageType.Binary, true, m_CancellationToken); //发送数据StringBuilder sb = new StringBuilder();//播放队列.Clear();while (m_WebSocket.State == WebSocketState.Open){var result = new byte[4096];await m_WebSocket.ReceiveAsync(new ArraySegment<byte>(result), m_CancellationToken);//接受数据List<byte> list = new List<byte>(result); while (list[list.Count - 1] == 0x00) list.RemoveAt(list.Count - 1);//去除空字节  var str = Encoding.UTF8.GetString(list.ToArray());sb.Append(str);if (str.EndsWith("}")){//获取返回的数据ResponseData _responseData = JsonUtility.FromJson<ResponseData>(sb.ToString());sb.Clear();if (_responseData.header.code != 0){//返回错误PrintErrorLog(_responseData.header.code);m_WebSocket.Abort();break;}if (_responseData.header.status != 0){byte[] audioBytes = Convert.FromBase64String(_responseData.payload.audio.audio);float[] audioData = ConvertByteToFloat(audioBytes);lock (m_AudioQueue){foreach (float f in audioData) m_AudioQueue.Enqueue(f);}if (_responseData.header.status == 2){m_WebSocket.Abort();break;}}}}}catch (Exception ex){Debug.LogError("报错信息: " + ex.Message);m_WebSocket.Dispose();}}float[] ConvertByteToFloat(byte[] byteArray){// 假设是16位PCM数据float[] floatArray = new float[byteArray.Length / 2];for (int i = 0; i < floatArray.Length; i++){short sample = (short)((byteArray[i * 2 + 1] << 8) | byteArray[i * 2]);floatArray[i] = sample / 32768.0f;}return floatArray;}public static byte[] Base64Decode(string base64String){try{return Convert.FromBase64String(base64String);}catch (FormatException ex){Debug.LogError($"Base64 解码失败: {ex.Message}");return null;}}#endregion#region 工具方法/// <summary>/// 打印错误日志/// </summary>/// <param name="status"></param>private void PrintErrorLog(int status){switch (status) { case 10009:Debug.LogError("输入数据非法 / 检查输入数据");return;case 10010:Debug.LogError("没有授权许可或授权数已满 / 提交工单");return;case 10019:Debug.LogError("session超时 / 检查是否数据发送完毕但未关闭连接");return;case 10043:Debug.LogError("音频解码失败 / 检查aue参数,如果为speex,请确保音频是speex音频并分段压缩且与帧大小一致");return;case 10114:Debug.LogError("session 超时 / 会话时间超时,检查是否发送数据时间超过了60s");return;case 10139:Debug.LogError("参数错误 / 检查参数是否正确");return;case 10160:Debug.LogError("请求数据格式非法 / 检查请求数据是否是合法的json");return;case 10161:Debug.LogError("base64解码失败 / 检查发送的数据是否使用base64编码了");return;case 10163:Debug.LogError("参数校验失败 / 具体原因见详细的描述");return;case 10200:Debug.LogError("读取数据超时 / 检查是否累计10s未发送数据并且未关闭连接");return;case 10222:Debug.LogError("1.上传的数据超过了接口上限; 2.SSL证书无效; / 1.检查接口上传的数据(文本、音频、图片等)是否超越了接口的最大限制,可到相应的接口文档查询具体的上限; 2. 请将log导出发到工单");return;case 10223:Debug.LogError("lb 找不到节点 / 提交工单");return;case 10313:Debug.LogError("appid和apikey不匹配 / 检查appid是否合法");return;case 10317:Debug.LogError("版本非法 / 请到控制台提交工单联系技术人员");return;case 10700:Debug.LogError("引擎异常 / 按照报错原因的描述,对照开发文档检查输入输出,如果仍然无法排除问题,请提供sid以及接口返回的错误信息,到控制台提交工单联系技术人员排查。");return;case 11200:Debug.LogError("功能未授权 / 请先检查appid是否正确,并且确保该appid下添加了相关服务。若没问题,则按照如下方法排查。 1. 确认总调用量是否已超越限制,或者总次数授权已到期,若已超限或者已过期请联系商务人员。 2. 查看是否使用了未授权的功能,或者授权已过期。");return;case 11201:Debug.LogError("该APPID的每日交互次数超过限制 / 根据自身情况提交应用审核进行服务量提额,或者联系商务购买企业级正式接口,获得海量服务量权限以便商用。");return;case 11503:Debug.LogError("服务内部响应数据错误 / 提交工单");return;case 11502:Debug.LogError("服务配置错误 / 提交工单");return;}if (status >= 100001 && status <= 100010) {Debug.LogError("调用引擎时出现错误 / 请根据message中包含的errno前往 5.2引擎错误码 查看对应的说明及处理策略");return;}Debug.LogError("平台未知错误,错误代码:" + status);}/// <summary>/// byte[]数组转化为AudioClip可读取的float[]类型/// </summary>/// <param name="byteArray"></param>/// <returns></returns>public float[] BytesToFloat(byte[] byteArray){float[] sounddata = new float[byteArray.Length / 2];for (int i = 0; i < sounddata.Length; i++){sounddata[i] = BytesToFloat(byteArray[i * 2], byteArray[i * 2 + 1]);}return sounddata;}private float BytesToFloat(byte firstByte, byte secondByte){//小端和大端顺序要调整short s;if (BitConverter.IsLittleEndian)s = (short)((secondByte << 8) | firstByte);elses = (short)((firstByte << 8) | secondByte);// convert to range from -1 to (just below) 1return s / 32768.0F;}#endregion#region 数据定义public class TTSRequestBuilder{public static string BuildTTSRequest(string appId,int headerStatus,string vcn,int volume,int speed,int pitch,int payloadStatus,string payloadText){// 创建请求对象var request = new TTSRequest{header = new Header{app_id = appId,status = headerStatus},parameter = new Parameter{tts = new TTS{vcn = vcn,volume = volume,speed = speed,pitch = pitch,audio = new Audio() // 使用默认值}},payload = new Payload{text = new Text{status = payloadStatus,text = payloadText}}};// 序列化为JSONreturn JsonUtility.ToJson(request, true);}}[System.Serializable]public class TTSRequest{public Header header;public Parameter parameter;public Payload payload;}[System.Serializable]public class Header{public string app_id;public int status;}[System.Serializable]public class Parameter{public TTS tts;}[System.Serializable]public class TTS{public string vcn;public int volume;public int rhy = 0;       // 默认值public int speed;public int pitch;public int bgs = 0;       // 默认值public int reg = 0;       // 默认值public int rdn = 0;       // 默认值public Audio audio;}[System.Serializable]public class Audio{public string encoding = "raw";       // 默认值public int sample_rate = 24000;       // 默认值public int channels = 1;              // 默认值public int bit_depth = 16;            // 默认值public int frame_size = 0;             // 默认值}[System.Serializable]public class Payload{public Text text;}[System.Serializable]public class Text{public string encoding = "utf8";       // 默认值public string compress = "raw";        // 默认值public string format = "plain";        // 默认值public int status;public int seq = 0;                   // 默认值public string text;}/// <summary>/// 获取数据/// </summary>[Serializable]public class ResponseData{public ResHeader header;public ResPayload payload;public string message;}[Serializable]public class ResHeader{public int code;public string message;public string sid;public int status;}[Serializable]public class ResPayload{public ResAudio audio;public ResPybuf pybuf;}[Serializable]public class ResAudio{public string encoding;public int sample_rate;public int channels;public int bit_depth;public int status;public int seq;public int frame_size;public string audio;}[Serializable]public class ResPybuf{public string encoding;public string compress;public string format;public int status;public int seq;public string text;}#endregion#region 设置项public enum Speaker{聆飞逸_男声,聆小璇_女声,聆佑佑_童年女声,聆玉昭_女声,聆小璃_女声,聆飞哲_男声,聆小玥_女声,聆玉言_女声,聆小琪_女声}/// <summary>/// 设置声音/// </summary>/// <param name="_speeker"></param>/// <returns></returns>private string GetVcn(Speaker _speeker){if (_speeker == Speaker.聆飞逸_男声){return "x5_lingfeiyi_flow";}else if (_speeker == Speaker.聆小璇_女声){return "x4_lingxiaoxuan_oral";}else if (_speeker == Speaker.聆佑佑_童年女声){return "x4_lingyouyou_oral";}else if (_speeker == Speaker.聆玉昭_女声){return "x4_lingyuzhao_oral";}else if (_speeker == Speaker.聆小璃_女声){return "x4_lingxiaoli_oral";}else if (_speeker == Speaker.聆飞哲_男声){return "x4_lingfeizhe_oral";}else if (_speeker == Speaker.聆小玥_女声){return "x5_lingxiaoyue_flow";}else if (_speeker == Speaker.聆玉言_女声){return "x5_lingyuyan_flow";}else if (_speeker == Speaker.聆小琪_女声){return "x4_lingxiaoqi_oral";}return "x5_lingfeiyi_flow";}#endregion
}
  • 同样的方法,填写好API后,绑定起来就可以使用了
    在这里插入图片描述
    在这里插入图片描述

相关文章:

Unity数字人开发笔记——讯飞超拟人语音

基于上一篇&#xff1a; https://blog.csdn.net/qq_17523181/article/details/148255809?spm1001.2014.3001.5501 https://blog.csdn.net/qq_17523181/article/details/148264127?spm1011.2415.3001.5331 讯飞默认的语音非常机械&#xff0c;更换为讯飞的超拟人语音 一、讯飞…...

C# 文件 I/O 操作详解:从基础到高级应用

在软件开发中&#xff0c;文件操作&#xff08;I/O&#xff09;是一项基本且重要的功能。无论是读取配置文件、存储用户数据&#xff0c;还是处理日志文件&#xff0c;C# 都提供了丰富的 API 来高效地进行文件读写操作。本文将全面介绍 C# 中的文件 I/O 操作&#xff0c;涵盖基…...

OpenCV 第7课 图像处理之平滑(二)

1. 示例代码 import cv2 import numpy as np import matplotlib.pyplot as pltimg = cv2.imread(noise.jpg)blur1 = cv2.blur(img, (5, 5)) blur2 = cv2.GaussianBlur(img, (5, 5), 1) blur3 = cv2.medianBlur(img, 5) plt.figure(figsize=(10, 5), dpi=100) plt.rcParam…...

Visual Studio笔记:MSVC工具集、MSBuild

1. MSVC工具集 1.1 什么叫MSVC工具集 也可以说Visual Studio平台工具集&#xff08;Platform toolset&#xff09;. 这些工具包括 C/C 编译器、链接器、汇编程序和其他生成工具以及匹配的库和头文件。 Visual Studio 2015、Visual Studio 2017 和 Visual Studio 2019 是二进制…...

【Netty系列】核心概念

目录 1. EventLoop 与线程模型 2. Channel&#xff08;通道&#xff09; 3. ChannelHandler 与 Pipeline 4. ByteBuf&#xff08;数据容器&#xff09; 5. Bootstrap 与 ServerBootstrap 6. Future 与 Promise 7. 其他核心概念 总结 Netty 是一个高性能、异步事件驱动的…...

Axure中继器交互完全指南:核心函数解析×场景实战×避坑策略(懂得才能应用)

亲爱的小伙伴,在您浏览之前,烦请关注一下,在此深表感谢!如有帮助请订阅专栏! Axure产品经理精品视频课已登录CSDN可点击学习https://edu.csdn.net/course/detail/40420 主要内容:中继器核心函数解析、场景方法详解、注意事项、特殊函数区别 课程目标:提高中继器的掌握…...

DeepSeek 赋能数字人直播带货:技术革新重塑电商营销新生态

目录 一、引言二、DeepSeek 技术探秘2.1 DeepSeek 技术原理剖析2.2 DeepSeek 与其他大模型对比优势 三、数字人直播带货现状洞察3.1 数字人直播带货发展历程回顾3.2 市场规模与增长趋势分析3.3 现存问题与挑战探讨 四、DeepSeek 在数字人直播带货中的应用实例4.1 交个朋友的成功…...

高端制造行业 VMware 替代案例合集:10+ 头部新能源、汽车、半导体制造商以国产虚拟化支持 MES、PLM 等核心应用系统

在“中国制造 2025”政策的推动下&#xff0c;国内的新能源、汽车制造、半导体、高端装备等高端制造产业迎来了蓬勃发展&#xff0c;成为全球制造业版图中举足轻重的力量。订单数量的激增与国产化转型的趋势&#xff0c;也为高端制造企业的 IT 基础设施带来了新的挑战&#xff…...

【b站计算机拓荒者】【2025】微信小程序开发教程 - chapter3 项目实践 - 3人脸识别采集统计人脸检测语音识别

https://www.bilibili.com/video/BV1WgQdYNERe/?p87&spm_id_from333.788.top_right_bar_window_history.content.click&vd_sourcec919d6976fd77ac77f9860cf2e7e0e11 1 人脸识别 # 1 采集完-人脸图片好上传到百度人脸识别-后期使用百度进行人脸识别-保存、删除等-后期…...

达梦的TEMP_SPACE_LIMIT参数

达梦的TEMP_SPACE_LIMIT参数 TEMP_SPACE_LIMIT是达梦数据库中控制临时表空间使用上限的重要参数&#xff0c;它限制了数据库会话可以使用的临时表空间总大小。 一、参数基本说明 1. 参数作用 限制单个会话可以使用的临时表空间总量防止异常SQL消耗过多临时空间影响系统稳定…...

24核32G,千兆共享:裸金属服务器的技术原理与优势

在云计算和数据中心领域&#xff0c;裸金属服务器正逐渐成为企业追求高性能计算的热门选择。本文将深入探讨裸金属服务器的技术原理&#xff0c;以及以“24核32G&#xff0c;千兆共享”配置为代表的裸金属服务器所具备的独特优势。 一、裸金属服务器的技术原理 &#xff08;一…...

杆塔倾斜在线监测装置:电力设施安全运行的“数字守卫”

在输电线路、通信基站及风电设施等场景中&#xff0c;杆塔作为支撑核心设备的基础结构&#xff0c;其稳定性直接关系到能源传输与信息通信的安全。传统人工巡检方式存在效率低、响应滞后等局限&#xff0c;而杆塔倾斜在线监测装置通过技术赋能&#xff0c;实现了对杆塔状态的实…...

C++23 新成员函数与字符串类型的改动

文章目录 引言std::basic_string::contains 与 std::basic_string_view::contains (P1679R3)功能介绍示例代码优势 禁止从 nullptr 构造 std::basic_string 和 std::basic_string_view (P2166R1)背景改动影响 std::basic_string_view 的显式范围构造函数 (P1989R2)功能介绍示例…...

在 ElementUI 中实现 Table 单元格合并

在 ElementUI 中实现 Table 单元格合并 在使用 ElementUI 的 Table 组件时&#xff0c;有时我们需要合并相邻的单元格&#xff0c;以提高表格的可读性和简洁性。下面是一个关于如何在 Table 中根据特定字段合并单元格的实现方法。 逻辑分析 spanMethod 方法&#xff1a;这是 …...

threejs渲染器和前端UI界面

1. three.js Canvas画布布局 学习本节课之前&#xff0c;可以先回顾下第一章节入门部分的6和12两小节关于threejs Canvas画布布局的讲解。 网页上局部特定尺寸&#xff1a;1.6 第一个3D案例—渲染器(opens new window) 全屏&#xff0c;随窗口变化:1.12 Canvas画布布局和全屏…...

AI笔记 - 网络模型 - mobileNet

网络模型 mobileNet mobileNet V1网络结构深度可分离卷积空间可分![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/aff06377feac40b787cfc882be7c6e5d.png) 参考 mobileNet V1 网络结构 MobileNetV1可以理解为VGG中的标准卷积层换成深度可分离卷积 可分离卷积主要有…...

day12 leetcode-hot100-20(矩阵3)

48. 旋转图像 - 力扣&#xff08;LeetCode&#xff09; 1.辅助数组法&#xff08;题目不让&#xff09; 思路&#xff1a;很简单&#xff0c;新建一个二维数组&#xff0c;直接找新数组与旧数组的规律即可。比如这个旋转90。那就是相当于 new[col][n-row-1]old[row][col],然后…...

【Java开发日记】基于 Spring Cloud 的微服务架构分析

目录 1、Spring Cloud 2、Spring Cloud 的核心组件 1. Eureka&#xff08;注册中心&#xff09; 2. Zuul&#xff08;服务网关&#xff09; 3. Ribbon&#xff08;负载均衡&#xff09; 4. Hystrix&#xff08;熔断保护器&#xff09; 5. Feign&#xff08;REST转换器&a…...

接口性能优化

一、耗时统计 在做接口的性能优化时&#xff0c;最重要的是知道时间消耗在哪里。 可以用StopWatch&#xff0c;进行耗时统计。 详情见&#xff1a; https://blog.csdn.net/sinat_32502451/article/details/148350451 二、链路追踪 如果团队使用了Skywalking&#xff0c;可以…...

AWTK 嵌入式Linux平台实现多点触控缩放旋转以及触点丢点问题解决

前言 最近涉及海图的功能交互&#xff0c;多点触摸又开始找麻烦。 在PC/Web平台awtk是通过底层的sdl2库来实现多点触摸&#xff0c;但是在嵌入式Linux平台&#xff0c;可能是考虑到性能原因&#xff0c;awtk并没有采用sdl库来做事件处理&#xff0c;而是自己实现一个awtk-lin…...

尚硅谷redis7 93-97 springboot整合reids之总体概述

93 springboot整合reids之总体概述 总体概述 jedis-lettuce-RedisTemplate三者的联系 名称类型作用描述和其它的关系JedisRedis 客户端早期主流的 Java Redis 客户端&#xff0c;基于阻塞 I/O&#xff0c;同步操作可作为 RedisTemplate 的底层连接实现LettuceRedis 客户端基…...

Flutter、React Native、Unity 下的 iOS 性能与调试实践:兼容性挑战与应对策略(含 KeyMob 工具经验)

移动端跨平台开发逐渐成为常态&#xff0c;Flutter、React Native、Unity、Hybrid App 等框架在各类 iOS 项目中频繁出现。但随之而来的&#xff0c;是一系列在 iOS 设备上调试难、性能数据采集难、日志整合难的问题。 今天这篇文章&#xff0c;我从实际项目出发&#xff0c;聊…...

声纹技术体系:从理论基础到工程实践的完整技术架构

文章目录 一、声纹技术的理论基础与概念内核1.1 声纹的生物学本质与数学表征1.2 特征提取的理论基础与实现机制 二、声纹识别技术的演进逻辑与方法体系2.1 传统统计学方法的理论架构2.2 深度学习方法的技术革新2.3 损失函数的设计原理与优化策略 三、声纹识别系统的架构设计与模…...

行为型:命令模式

目录 1、核心思想 2、实现方式 2.1 模式结构 2.2 实现案例 3、优缺点分析 4、适用场景 5、实际应用 1、核心思想 目的&#xff1a;将指令信息封装成一个对象&#xff0c;并将此对象作为参数发送给接收方去执行&#xff0c;以使命令的请求方与执行方解耦 概念&#xff…...

构建多模型协同的Ollama智能对话系统

构建多模型协同的Ollama智能对话系统 在人工智能应用中&#xff0c;单一模型往往难以满足复杂场景的需求。本文将介绍如何整合多个Ollama模型&#xff0c;构建一个智能对话系统&#xff0c;实现情感分析、危机评估和智能回复的协同功能。 系统架构 该系统采用多模型pipeline…...

vue3 + WebSocket + Node 搭建前后端分离项目 开箱即用

[TOC](vue3 WebSocket Node 搭建前后端分离项目) 开箱即用 前言 top1&#xff1a;vue3.5搭建前端H5 top2&#xff1a;Node.js koa搭建后端服务接口 top3&#xff1a;WebSocket 长连接实现用户在线聊天 top4&#xff1a;接口实现模块化 Mysql 自定义 top5&#xff1a;文件上…...

Win10秘笈:两种方式修改网卡物理地址(MAC)

Win10秘笈&#xff1a;两种方式修改网卡物理地址&#xff08;MAC&#xff09; 在修改之前&#xff0c;可以先确定一下要修改的网卡MAC地址&#xff0c;查询方法有很多种&#xff0c;比如&#xff1a; 1、在设置→网络和Internet→WLAN/以太网&#xff0c;如下图所示。 2、在控…...

【软件】navicat 官方免费版

Navicat Premium Lite https://www.navicat.com.cn/download/navicat-premium-lite...

【深度学习】16. Deep Generative Models:生成对抗网络(GAN)

Deep Generative Models&#xff1a;生成对抗网络&#xff08;GAN&#xff09; 什么是生成建模&#xff08;Generative Modeling&#xff09; 生成模型的主要目标是从数据中学习其分布&#xff0c;从而具备“生成”数据的能力。两个关键任务&#xff1a; 密度估计&#xff0…...

java操作服务器文件(把解析过的文件迁移到历史文件夹地下)

第一步导出依赖 <dependency><groupId>org.apache.sshd</groupId><artifactId>sshd-core</artifactId><version>2.13.0</version></dependency> 第二步写代码 public void moveFile( List<HmAnalysisFiles> hmAnalys…...