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

JAVA实现麦克风说话同声传译

一、能力与场景说明

同声传译,又称同步口译或同声翻译,是一种专业的口译形式,指的是在讲话者发言时,口译员几乎同时将讲话内容翻译成目标语言。这种翻译方式通常用于国际会议、高级别政治或商业会谈、研讨会和其他需要即时多语言交流的场合。本文是用JAVA调用原生麦克风技术,实现产生音频的同时用麦克风实现边说边翻译成英文的技术。不限制录音时长。

二、同传主调用代码

package main.com.iflytek;import com.google.gson.Gson;
import com.google.gson.JsonObject;
import main.com.util.VideoPlayerService;
import okhttp3.*;
import main.com.util.AuthUtils;
import main.com.util.PcmToWav;import javax.sound.sampled.AudioInputStream;
import java.io.*;
import java.util.*;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;/*** 1、同声传译接口,可以将音频流实时翻译为不同语种的文本,并输对应的音频内容,广泛应用于国际论坛、智能会议、智慧教育、跨国交流等场景。*/
public class SimultaneousTranslationMain extends WebSocketListener {private static String requestUrl = "wss://ws-api.xf-yun.com/v1/private/simult_interpretation";//控制台获取以下信息private static String APPID = "";private static String apiSecret = "";private static String apiKey = "";private static final String domain = "ist_ed_open";private static final String language = "zh_cn";private static final String accent = "mandarin";// 翻译所需参数,从中文-英文private static final String from = "cn"; // 源文件的语言类型private static final String to = "en"; // 目标文件的语言类型// 发声发音人private static final String vcn = "x2_catherine";// 输出音频编码方式 PCMprivate static final String encoding = "raw";// 输入的源音频文件private static final String inputAudioPcm = "input/audio/original.pcm";// 输出的音频与文本文件private static final String outPutPcm = "output/audio/trans.pcm";private static final String outPutWav = "output/audio/trans.wav";private static final String asr_result = "output/text/asr.txt";private static final String trans_result = "output/text/trans.txt";public static final int StatusFirstFrame = 0;public static final int StatusContinueFrame = 1;public static final int StatusLastFrame = 2;public static final Gson gson = new Gson();private static BlockingQueue<String> queue = new LinkedBlockingQueue<>();private static boolean overFlag = false;public static byte[] audioDataByteArray;public static Long ivwStartTime;public static Long ivwEndTime;// 主函数入口public static void main(String[] args) {// 清空文件夹clearDir();Thread thread = new Thread(new videoPlayer());thread.start();// 构建鉴权urlString authUrl = AuthUtils.assembleRequestUrl(requestUrl, apiKey, apiSecret);// System.out.println(authUrl);OkHttpClient client = new OkHttpClient.Builder().build();Request request = new Request.Builder().url(authUrl).build();// System.out.println("url===>" + authUrl);WebSocket webSocket = client.newWebSocket(request, new SimultaneousTranslationMain());try {//打开音频文件int frameSize = 1280; // 每一帧音频的大小 1280/40msint interval = 40;int status = 0;  // 音频的状态int count = 0;Constants.IVW_ASR_TARGET_DATA_LINE.open(Constants.IVW_ASR_AUDIO_FORMAT);Constants.IVW_ASR_TARGET_DATA_LINE.start();ivwStartTime = System.currentTimeMillis(); // 更新开始时间// 发送音频end:while (true) {//int len = fs.read(buffer);audioDataByteArray = new byte[Constants.IVW_FRAME_SIZE];int len = new AudioInputStream(Constants.IVW_ASR_TARGET_DATA_LINE).read(audioDataByteArray);ivwEndTime = System.currentTimeMillis();// System.out.println(ivwEndTime - ivwStartTime);if (len < frameSize || (ivwEndTime - ivwStartTime) > 60000) { // 大于一分钟自动停止status = StatusLastFrame;  //文件读完,改变status 为 2}switch (status) {case StatusFirstFrame:   // 第一帧音频status = 0JsonObject frame = new JsonObject();JsonObject header = new JsonObject();  //第一帧必须发送JsonObject parameter = new JsonObject();JsonObject ist = new JsonObject();JsonObject streamtrans = new JsonObject();JsonObject tts = new JsonObject();JsonObject tts_results = new JsonObject();JsonObject payload = new JsonObject();JsonObject data = new JsonObject();// 填充headerheader.addProperty("app_id", APPID);//appid 必须带上,只需第一帧发送header.addProperty("status", 0);// 填充parameter// ist参数填充ist.addProperty("eos", 600000);ist.addProperty("vto", 15000);ist.addProperty("accent", accent);ist.addProperty("language", language);ist.addProperty("language_type", 1);ist.addProperty("domain", domain);// streamtrans参数填充streamtrans.addProperty("from", from);streamtrans.addProperty("to", to);// tts参数填充tts.addProperty("vcn", vcn);tts_results.addProperty("encoding", "raw");tts_results.addProperty("sample_rate", 16000);tts_results.addProperty("channels", 1);tts_results.addProperty("bit_depth", 16);tts.add("tts_results", tts_results);parameter.add("ist", ist);parameter.add("streamtrans", streamtrans);parameter.add("tts", tts);//填充payloaddata.addProperty("audio", Base64.getEncoder().encodeToString(Arrays.copyOf(audioDataByteArray, len)));data.addProperty("encoding", encoding);data.addProperty("sample_rate", 16000);data.addProperty("status", status);data.addProperty("seq", count);payload.add("data", data);//填充frameframe.add("header", header);frame.add("parameter", parameter);frame.add("payload", payload);webSocket.send(frame.toString());status = StatusContinueFrame;  // 发送完第一帧改变status 为 1System.out.println("send first 请开始说出中文:");break;case StatusContinueFrame:  //中间帧status = 1JsonObject contineuFrame = new JsonObject();JsonObject header1 = new JsonObject();JsonObject payload1 = new JsonObject();JsonObject data1 = new JsonObject();// 填充headheader1.addProperty("status", 1);header1.addProperty("app_id", APPID);//填充payloaddata1.addProperty("audio", Base64.getEncoder().encodeToString(Arrays.copyOf(audioDataByteArray, len)));data1.addProperty("encoding", encoding);data1.addProperty("sample_rate", 16000);data1.addProperty("status", status);data1.addProperty("seq", count);payload1.add("data", data1);contineuFrame.add("header", header1);contineuFrame.add("payload", payload1);webSocket.send(contineuFrame.toString());//  System.out.println("send continue");break;case StatusLastFrame:    // 最后一帧音频status = 2 ,标志音频发送结束String audio = "";if (len != 0) {audio = Base64.getEncoder().encodeToString(Arrays.copyOf(audioDataByteArray, len));}JsonObject lastFrame = new JsonObject();JsonObject header2 = new JsonObject();JsonObject payload2 = new JsonObject();JsonObject data2 = new JsonObject();// 填充headheader2.addProperty("status", 2);header2.addProperty("app_id", APPID);//填充payloaddata2.addProperty("audio", audio);data2.addProperty("encoding", encoding);data2.addProperty("sample_rate", 16000);data2.addProperty("status", status);data2.addProperty("seq", count);payload2.add("data", data2);lastFrame.add("header", header2);lastFrame.add("payload", payload2);webSocket.send(lastFrame.toString());System.out.println("send last 中文讲话结束!");break end;}count++;Thread.sleep(interval); //模拟音频采样延时}System.out.println("all data is send 所有音频数据发送完毕!");} catch (Exception e) {e.printStackTrace();}}@Overridepublic void onOpen(WebSocket webSocket, Response response) {super.onOpen(webSocket, response);// System.out.println("open connection");}// 客户端接收服务端的消息并处理@Overridepublic void onMessage(WebSocket webSocket, String text) {super.onMessage(webSocket, text);ResponseData resp = gson.fromJson(text, ResponseData.class);// System.err.println(text);if (resp != null) {if (resp.header.code != 0) {System.out.println("error=>" + resp.header.message + " sid=" + resp.header.sid + " 错误码=" + resp.header.code);return;}if (resp.header != null) {if (resp.header.code == 0) {// System.out.println(text);if (resp.payload != null) {// 接收到的识别结果写到文本if (resp.payload.recognition_results != null) {String s1 = resp.payload.recognition_results.text;byte[] trans1 = Base64.getDecoder().decode(s1);String res1 = new String(trans1);try {writeStringToFile(res1, asr_result);} catch (IOException e) {e.printStackTrace();}}// 接收到的翻译结果写到文本if (resp.payload.streamtrans_results != null) {String s2 = resp.payload.streamtrans_results.text;byte[] trans = Base64.getDecoder().decode(s2);String res = new String(trans);try {writeStringToFile(res, trans_result);} catch (IOException e) {e.printStackTrace();}}// 把接收到的音频流合成PCMif (resp.payload.tts_results != null) {String s = resp.payload.tts_results.audio;queue.add(s);// System.err.println("执行一次");try {writeBytesToFile(Base64.getDecoder().decode(s), outPutPcm);} catch (IOException e) {e.printStackTrace();}}}}if (resp.header.status == 2) {// todo  resp.data.status ==2 说明数据全部返回完毕,可以关闭连接,释放资源System.out.println("session end  同声传译返回完毕!");System.out.println("本次请求的sid==》 " + resp.header.sid);System.out.println("数据处理完毕,等待实时转译结束!");overFlag = true;try {// 流程完毕后,输出音频文件,把PCM转换为WAVPcmToWav.convertAudioFiles(outPutPcm, outPutWav);} catch (IOException e) {e.printStackTrace();}webSocket.close(1000, "");if (queue.size() == 0) {System.exit(0);}} else {// todo 根据返回的数据处理}}}}@Overridepublic void onFailure(WebSocket webSocket, Throwable t, Response response) {super.onFailure(webSocket, t, response);System.out.println(t.getMessage());try {System.out.println("错误信息:" + response);if (response == null) {return;}System.out.println("错误信息" + response.code());System.out.println(response.body().string());} catch (IOException e) {e.printStackTrace();}}// 实时播放音频流方法static class videoPlayer implements Runnable {@Overridepublic void run() {while (true) {if (overFlag && queue.size() == 0) {break;}if (queue.size() != 0) {String poll = queue.poll();VideoPlayerService.videoPlay(Base64.getDecoder().decode(poll));}}System.out.println("实时转译结束!!!");System.exit(1000);}}// 清空已存在文件public static void clearDir() {String path = "output";File file = new File(path);for (File f : file.listFiles()) {if (f.isDirectory()) {for (File subFile : f.listFiles()) {if (subFile != null) {subFile.delete();}}}}System.out.println("结果集初始化成功------");}// 写入文件public static void writeBytesToFile(byte[] bs, String path) throws IOException {OutputStream out = new FileOutputStream(path, true);InputStream is = new ByteArrayInputStream(bs);byte[] buff = new byte[1024];int len = 0;while ((len = is.read(buff)) != -1) {out.write(buff, 0, len);}is.close();out.close();}// 写入文件public static void writeStringToFile(String content, String path) throws IOException {OutputStream out = new FileOutputStream(path, true);out.write(content.getBytes());out.close();}// JSON解析public static class ResponseData {header header;payload payload;}public static class payload {streamtrans_results streamtrans_results;recognition_results recognition_results;tts_results tts_results;@Overridepublic String toString() {return "payload{" + "streamtrans_results=" + streamtrans_results + ", recognition_results=" + recognition_results + ", tts_results=" + tts_results + '}';}}public static class header {int code;String message;String sid;int status;}public static class recognition_results {String encoding;String format;String text;int status;@Overridepublic String toString() {return "recognition_results{" + "encoding='" + encoding + '\'' + ", format='" + format + '\'' + ", text='" + text + '\'' + ", status=" + status + '}';}}public static class streamtrans_results {String encoding;String format;String text;int status;@Overridepublic String toString() {return "streamtrans_results{" + "encoding='" + encoding + '\'' + ", format='" + format + '\'' + ", text='" + text + '\'' + ", status=" + status + '}';}}public static class tts_results {String encoding;String audio;int sample_rate;int channels;int bit_depth;int status;int seq;int frame_size;@Overridepublic String toString() {return "tts_results{" + "encoding='" + encoding + '\'' + ", audio='" + audio + '\'' + ", sample_rate=" + sample_rate + ", channels=" + channels + ", bit_depth=" + bit_depth + ", status=" + status + ", seq=" + seq + ", frame_size=" + frame_size + '}';}}
}

三、鉴权代码

package main.com.util;import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.Base64;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;/*** @Author:sjliu7* 鉴权使用* @Date:2019/7/31 15:23*/
public class AuthUtils {private static final String serviceId = "simult_interpretation";/*** 生成用于鉴权的URL,websocket 接口* @param requestUrl* @param apiKey* @param apiSecret* @return final requestUrl*/public static String assembleRequestUrl(String requestUrl, String apiKey, String apiSecret) {URL url = null;String  httpRequestUrl = requestUrl.replace("ws://", "http://").replace("wss://","https://" );try {url = new URL(httpRequestUrl);SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);// format.setTimeZone(TimeZone.getTimeZone("UTC"));format.setTimeZone(TimeZone.getTimeZone("GMT"));String date = format.format(new Date());// date = "Mon, 13 Dec 2021 03:05:05 GMT";String host = url.getHost();StringBuilder builder = new StringBuilder("host: ").append(host).append("\n").//append("date: ").append(date).append("\n").//append("GET ").append(url.getPath()).append(" HTTP/1.1");// System.out.println(builder);Charset charset = Charset.forName("UTF-8");Mac mac = Mac.getInstance("hmacsha256");// System.out.println(builder.toString());SecretKeySpec spec = new SecretKeySpec(apiSecret.getBytes(charset), "hmacsha256");mac.init(spec);byte[] hexDigits = mac.doFinal(builder.toString().getBytes(charset));String sha = Base64.getEncoder().encodeToString(hexDigits);// System.out.println(sha);String authorization = String.format("api_key=\"%s\", algorithm=\"%s\", headers=\"%s\", signature=\"%s\"", apiKey, "hmac-sha256", "host date request-line", sha);String authBase = Base64.getEncoder().encodeToString(authorization.getBytes(charset));// System.out.println(authBase);// System.out.println(String.format("%s?authorization=%s&host=%s&date=%s&serviceId=%s", requestUrl, URLEncoder.encode(authBase), URLEncoder.encode(host), URLEncoder.encode(date),serviceId));return String.format("%s?authorization=%s&host=%s&date=%s&serviceId=%s", requestUrl, URLEncoder.encode(authBase), URLEncoder.encode(host), URLEncoder.encode(date),serviceId);} catch (Exception e) {throw new RuntimeException("assemble requestUrl error:"+e.getMessage());}}
}

四、PCM转成WAV

package main.com.util;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class PcmToWav {/*** @param src    待转换文件路径* @param target 目标文件路径* @throws IOException 抛出异常*/public static void convertAudioFiles(String src, String target) throws IOException {FileInputStream fis = new FileInputStream(src);FileOutputStream fos = new FileOutputStream(target);//计算长度byte[] buf = new byte[1024 * 4];int size = fis.read(buf);int PCMSize = 0;while (size != -1) {PCMSize += size;size = fis.read(buf);}fis.close();//填入参数,比特率等等。这里用的是16位单声道 8000 hzWaveHeader header = new WaveHeader();//长度字段 = 内容的大小(PCMSize) + 头部字段的大小(不包括前面4字节的标识符RIFF以及fileLength本身的4字节)header.fileLength = PCMSize + (44 - 8);header.FmtHdrLeth = 16;header.BitsPerSample = 16;header.Channels = 2;header.FormatTag = 0x0001;header.SamplesPerSec = 8000;header.BlockAlign = (short) (header.Channels * header.BitsPerSample / 8);header.AvgBytesPerSec = header.BlockAlign * header.SamplesPerSec;header.DataHdrLeth = PCMSize;byte[] h = header.getHeader();assert h.length == 44; //WAV标准,头部应该是44字节fos.write(h, 0, h.length);fis = new FileInputStream(src);size = fis.read(buf);while (size != -1) {fos.write(buf, 0, size);size = fis.read(buf);}fis.close();fos.close();System.out.println("Convert OK!");}
}

五、音频播放

package main.com.util;
import javax.sound.sampled.*;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
public class VideoPlayerService {public static SourceDataLine auline = null;static {AudioFormat audioFormat=new AudioFormat(16000F, 16, 1,true,false);DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat);try {auline = (SourceDataLine) AudioSystem.getLine(info);auline.open(audioFormat);auline.start();} catch (LineUnavailableException e) {e.printStackTrace();} catch (Exception e) {e.printStackTrace();}}public static byte[] byteArray(String file) throws IOException {BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));ByteArrayOutputStream out = new ByteArrayOutputStream(1024);System.out.println("Available bytes:" + in.available());byte[] temp = new byte[1024];int size = 0;while ((size = in.read(temp)) != -1) {out.write(temp, 0, size);}in.close();byte[] content = out.toByteArray();return content;}public static void videoPlay(byte[] video){auline.write(video,0,video.length);}
}

六、WAV头添加

package main.com.util;import java.io.ByteArrayOutputStream;
import java.io.IOException;public class WaveHeader {public final char fileID[] = {'R', 'I', 'F', 'F'};public int fileLength;public char wavTag[] = {'W', 'A', 'V', 'E'};public char FmtHdrID[] = {'f', 'm', 't', ' '};public int FmtHdrLeth;public short FormatTag;public short Channels;public int SamplesPerSec;public int AvgBytesPerSec;public short BlockAlign;public short BitsPerSample;public char DataHdrID[] = {'d', 'a', 't', 'a'};public int DataHdrLeth;public byte[] getHeader() throws IOException {ByteArrayOutputStream bos = new ByteArrayOutputStream();WriteChar(bos, fileID);WriteInt(bos, fileLength);WriteChar(bos, wavTag);WriteChar(bos, FmtHdrID);WriteInt(bos, FmtHdrLeth);WriteShort(bos, FormatTag);WriteShort(bos, Channels);WriteInt(bos, SamplesPerSec);WriteInt(bos, AvgBytesPerSec);WriteShort(bos, BlockAlign);WriteShort(bos, BitsPerSample);WriteChar(bos, DataHdrID);WriteInt(bos, DataHdrLeth);bos.flush();byte[] r = bos.toByteArray();bos.close();return r;}private void WriteShort(ByteArrayOutputStream bos, int s) throws IOException {byte[] mybyte = new byte[2];mybyte[1] = (byte) ((s << 16) >> 24);mybyte[0] = (byte) ((s << 24) >> 24);bos.write(mybyte);}private void WriteInt(ByteArrayOutputStream bos, int n) throws IOException {byte[] buf = new byte[4];buf[3] = (byte) (n >> 24);buf[2] = (byte) ((n << 8) >> 24);buf[1] = (byte) ((n << 16) >> 24);buf[0] = (byte) ((n << 24) >> 24);bos.write(buf);}private void WriteChar(ByteArrayOutputStream bos, char[] id) {for (char c : id) {bos.write(c);}}
}

相关文章:

JAVA实现麦克风说话同声传译

一、能力与场景说明 同声传译&#xff0c;又称同步口译或同声翻译&#xff0c;是一种专业的口译形式&#xff0c;指的是在讲话者发言时&#xff0c;口译员几乎同时将讲话内容翻译成目标语言。这种翻译方式通常用于国际会议、高级别政治或商业会谈、研讨会和其他需要即时多语言…...

LabVIEW与PLC通讯方式及比较

LabVIEW与PLC之间的通讯方式多样&#xff0c;包括使用MODBUS协议、OPC&#xff08;OLE for Process Control&#xff09;、Ethernet/IP以及串口通讯等。这些通讯方式各有特点&#xff0c;选择合适的通讯方式可以提高系统的效率和稳定性。以下将详细介绍每种通讯方式的特点、优点…...

2024/6/30 英语每日一段

Years of economic and political turbulence have brought stagnation.“In a world where there is more risk and uncertainty, people become reluctant to voluntarily move jobs and find better jobs,” says Manning. At the same time, businesses have cut back on i…...

Postman接口测试工具的原理及应用详解(五)

本系列文章简介&#xff1a; 在当今软件开发的世界中&#xff0c;接口测试作为保证软件质量的重要一环&#xff0c;其重要性不言而喻。随着前后端分离开发模式的普及&#xff0c;接口测试已成为连接前后端开发的桥梁&#xff0c;确保前后端之间的数据交互准确无误。在这样的背景…...

208.贪心算法:买卖股票的最佳时机||(力扣)

代码解决 class Solution { public:int maxProfit(vector<int>& prices) {int result 0; // 初始化结果为0&#xff0c;表示初始利润为0// 从第二天开始遍历价格数组for (int i 1; i < prices.size(); i) {// 如果当天价格比前一天价格高&#xff0c;则将差价加…...

【论文阅读】伸缩密度比估计:Telescoping Density-Ratio Estimation

文章目录 一、文章概览&#xff08;一&#xff09;问题提出&#xff08;二&#xff09;文章工作 二、判别比估计和密度鸿沟问题三、伸缩密度比估计&#xff08;一&#xff09;核心思想&#xff08;二&#xff09;路标创建&#xff08;三&#xff09;桥梁构建&#xff08;四&…...

MongoDB数据库 MQL (MongoDB Query Language)语句大全

基本命令 连接到 MongoDB mongo显示所有数据库 show dbs选择&#xff08;或创建&#xff09;数据库 db集合操作 显示当前数据库中的所有集合 show collections创建集合 db.createCollection("myCollection")删除集合 db.myCollection.drop()文档操作 插入文…...

Java代码基础算法练习-计算平均身高-2024.07.02

任务描述&#xff1a; n个同学站成一排&#xff0c;求它们的平均身高 解决思路&#xff1a; 输入的学生人数为 for 循环次数&#xff0c;循环中每输入一个值就添加在总数中&#xff0c;循环结束总数除以对应的学生人数得到平均身高 代码示例&#xff1a; package a4_2024_07;…...

BIOS设置与系统分区

&#x1f4d1;打牌 &#xff1a; da pai ge的个人主页 &#x1f324;️个人专栏 &#xff1a; da pai ge的博客专栏 ☁️宝剑锋从磨砺出&#xff0c;梅花香自苦寒来 目录 一BIOS 1破解密码的前提 2B…...

linux的安装程序 与 文件 相关的命令

软件安装卸载命令 软件包介绍软件包命名格式dpkg命令apt-get命令apt-get命令 压缩和解压命令 压缩文件后缀 压缩命令打包和解包命令 tar命令 文件分割命令 split命令 文件操作相关命令 cat命令head命令tail命令more命令less命令管道命令wc 命令grep 命令find 命令cut 命令sort …...

SAP_ABAP相关日语单词

基本概念 1. プログラミング言語 (プログラミングげんご, Puroguramingu gengo) - 编程语言 2. 開発 (かいはつ, Kaihatsu) - 开发 3. システム (システム, Shisutemu) - 系统 4. モジュール (モジュール, Mojūru) - 模块 5. トランザクションコード (トランザクションコード,…...

Python中的除法操作详解

在Python编程中&#xff0c;除法是一个基础但极其重要的算术操作。Python提供了多种除法运算方式&#xff0c;以适应不同的计算需求。以下是对Python中除法操作的全面介绍&#xff0c;包括示例代码。 1. 普通除法 / 普通除法使用/运算符&#xff0c;它返回一个浮点数结果&…...

第1章 人工智能的基础概念与应用导论

亲爱的读者朋友们&#xff0c;你们好&#xff01;欢迎来到这个充满神奇与奥秘的人工智能世界。我知道&#xff0c;对于很多人来说&#xff0c;人工智能&#xff08;AI&#xff09;可能是个既神秘又高大上的词汇&#xff0c;仿佛遥不可及&#xff0c;只存在于科幻电影或者顶级科…...

jenkins api部署时,一直提示pending-Finished waiting

问题&#xff1a; 调用jenkins api部署时&#xff0c;一直提示pending-Finished waiting 解决方案&#xff1a; 这个问题困扰了很久&#xff0c;一直没有思路&#xff0c;后面看到调用jenkinsAPI本身会出现一段提示&#xff0c;pending in the quiet period&#xff0c;通过搜…...

AI在创造还是毁掉音乐之论文

AI在创造还是毁掉音乐&#xff1f; 简介&#xff1a;最近一个月&#xff0c;轮番上线的音乐大模型&#xff0c;一举将素人生产音乐的门槛降到了最低&#xff0c;并掀起了音乐圈会不会被AI彻底颠覆的讨论。短暂的兴奋后&#xff0c;AI产品的版权归属于谁&#xff0c;创意产业要…...

C++ STL容器:序列式容器-数组string,vector,array,bitset

摘要&#xff1a; CC STL&#xff08;Standard Template Library&#xff0c;标准模板库&#xff09;在C编程中的重要性不容忽视&#xff0c;STL提供了一系列容器、迭代器、算法和函数对象&#xff0c;这些组件极大地提高了C程序的开发效率和代码质量。 STL 容器 分为 2 大类 …...

ElementUI样式优化:el-input修改样式、el-table 修改表头样式、斑马格样式、修改滚动条样式、

效果图&#xff1a; 1、改变日期时间组件的字体颜色背景 .form-class ::v-deep .el-date-editor { border: 1px solid #326AFF; background: #04308D !important; } .form-class ::v-deep .el-date-editor.el-input__wrapper { box-shadow: 0 0 0 0px #326AFF inset; } // 输入…...

大数据面试题之Spark(6)

Spark输出文件的个数&#xff0c;如何合并小文件? Spark的driver是怎么驱动作业流程的? Spark SQL的劣势? 介绍下Spark Streaming和Structed Streaming Spark为什么比Hadoop速度快? DAG划分Spark源码实现? Spark Streaming的双流join的过程&#xff0c;怎么做的? …...

SpringSecurity中文文档(Servlet Anonymous Authentication)

Anonymous Authentication Overview 通常认为采用“默认拒绝”立场是良好的安全实践&#xff0c;您明确指定允许的内容并拒绝其他所有内容。定义未经身份验证的用户可以访问的内容是类似的情况&#xff0c;特别是对于 Web 应用程序。许多网站要求用户必须经过身份验证才能访问…...

【Spring Boot 事务管理】

Spring Boot 事务管理 一、Spring Boot中的事务管理1.声明式事务管理Transactional注解基本使用配置选项 2.编程式事务管理TransactionTemplatePlatformTransactionManager 二、Transactional注解深入1.基本使用基本属性 2.传播行为3.隔离级别4.事务超时设置5.回滚规则 三、事务…...

零基础转行AI?这份30天大模型学习方案带你从理论到项目实战

人工智能大模型&#xff08;Large Language Models, LLMs&#xff09;无疑是当前科技领域最炙手可热的技术。从ChatGPT的惊艳问世到各类开源模型的百花齐放&#xff0c;掌握大模型技术已成为许多技术人员提升核心竞争力的关键。然而&#xff0c;其涉及的知识体系庞大&#xff0…...

毕设程序java成人培训机构管理系统 基于Java的成人教育信息化管理平台 Java驱动的职业技能培训综合管理系统

毕设程序java成人培训机构管理系统2q5348ul&#xff08;配套有源码 程序 mysql数据库 论文&#xff09; 本套源码可以在文本联xi,先看具体系统功能演示视频领取&#xff0c;可分享源码参考。随着社会经济结构的持续转型与产业升级步伐加快&#xff0c;终身学习理念已深度融入现…...

论文写作“黑科技”:书匠策AI,期刊论文的智能魔法棒

在学术的奇妙世界里&#xff0c;论文写作就像是一场充满挑战的魔法冒险。每一位研究者都怀揣着将知识转化为智慧结晶的梦想&#xff0c;可面对期刊论文这座“魔法城堡”&#xff0c;常常感到无从下手。不过别担心&#xff0c;如今有一根神奇的“魔法棒”——书匠策AI&#xff0…...

学长亲荐 10个降AIGC软件:开源免费测评,帮你高效降AI率

在学术写作中&#xff0c;AI生成内容的普及带来了新的挑战——如何有效降低AIGC率&#xff0c;同时保持论文的原创性和逻辑性。近年来&#xff0c;越来越多的学生和研究人员开始依赖专业的AI降重工具&#xff0c;这些工具不仅能精准识别并去除AI痕迹&#xff0c;还能在不破坏原…...

nt!_DEVICE_NODE结构中的ResourceRequirements结构类型为_IO_RESOURCE_REQUIREMENTS_LIST

nt!_DEVICE_NODE结构中的ResourceRequirements结构类型为_IO_RESOURCE_REQUIREMENTS_LIST0: kd> !DevNode 0x899c1008 6 DevNode 0x899c1008 for PDO 0x899c1de0Parent 0x899c5850 Sibling 0000000000 Child 0x899875a8 InstancePath is "ACPI_HAL\PNP0C08\0&quo…...

企业级 YOLOv5 目标检测 API 开发:RESTful 接口设计 + 高并发压测实战(2026 版)

前言 “模型训练精度 99%&#xff0c;一上线接口就超时&#xff1f;” “单用户测试没问题&#xff0c;并发一上 10 QPS 显存直接爆掉&#xff1f;” “想做个通用的检测服务&#xff0c;结果代码耦合严重&#xff0c;换个模型要重构一半&#xff1f;” 在 2026 年的今天&#…...

Java Web MVC自习室管理和预约系统系统源码-SpringBoot2+Vue3+MyBatis-Plus+MySQL8.0【含文档】

摘要 随着高校教育规模的不断扩大&#xff0c;自习室资源的管理和分配问题日益突出。传统的人工管理方式效率低下&#xff0c;容易出现资源浪费和分配不均的情况。尤其是在考试周或毕业季&#xff0c;学生对于自习室座位的需求激增&#xff0c;如何高效、公平地分配座位资源成为…...

NumPy:ndarray 数组属性

在使用 NumPy 进行科学计算或数据分析时&#xff0c;数组对象不仅存储数据本身&#xff0c;还包含描述数组结构与内存布局的信息&#xff0c;这些信息被称为数组属性&#xff08;array attributes&#xff09;。通过这些属性&#xff0c;我们可以了解数组的维度结构、元素数量、…...

春联生成模型-中文-base实战:输入‘幸福‘、‘平安‘,AI自动创作完整春联

春联生成模型-中文-base实战&#xff1a;输入幸福、平安&#xff0c;AI自动创作完整春联 1. 项目介绍与核心功能 春节贴春联是中国传统文化的重要组成部分&#xff0c;但创作一副对仗工整、寓意吉祥的春联并不容易。春联生成模型-中文-base正是为解决这个问题而开发的AI应用。…...

千问3.5-27B多场景:食品包装标签图像识别与营养成分结构化

千问3.5-27B多场景&#xff1a;食品包装标签图像识别与营养成分结构化 1. 食品包装识别的行业痛点 在食品生产和零售行业&#xff0c;每天需要处理海量的包装标签信息。传统的人工录入方式存在三大痛点&#xff1a; 效率低下&#xff1a;一个熟练员工每小时只能处理20-30个产…...