语音文件格式修改
This commit is contained in:
@@ -80,7 +80,7 @@ public class ChatWebSocketHandler {
|
|||||||
byteBuffer.get(bytes);
|
byteBuffer.get(bytes);
|
||||||
log.info("2、运行时间:{}",System.currentTimeMillis()/1000);
|
log.info("2、运行时间:{}",System.currentTimeMillis()/1000);
|
||||||
// 生成唯一文件名
|
// 生成唯一文件名
|
||||||
String fileName = clientId + "_" + System.currentTimeMillis() + ".opus";
|
String fileName = clientId + "_" + System.currentTimeMillis() + ".webm";
|
||||||
String pathUrl = RuoYiConfig.getProfile()+VOICE_STORAGE_DIR + fileName;
|
String pathUrl = RuoYiConfig.getProfile()+VOICE_STORAGE_DIR + fileName;
|
||||||
// String pathUrl = "/Users/wangxiangshun/Desktop/0.8733346782733291.webm";
|
// String pathUrl = "/Users/wangxiangshun/Desktop/0.8733346782733291.webm";
|
||||||
log.info("文件路径为:{}", pathUrl);
|
log.info("文件路径为:{}", pathUrl);
|
||||||
@@ -153,8 +153,8 @@ public class ChatWebSocketHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 确保文件以.webm结尾
|
// 确保文件以.webm结尾
|
||||||
if (!filePath.toLowerCase().endsWith(".opus")) {
|
if (!filePath.toLowerCase().endsWith(".webm")) {
|
||||||
filePath += ".opus";
|
filePath += ".webm";
|
||||||
}
|
}
|
||||||
|
|
||||||
FileOutputStream fos = null;
|
FileOutputStream fos = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user