Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
0b5beb36
Commit
0b5beb36
authored
Mar 25, 2024
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 使用硬编码文件分隔符会导致可移植性问题。
Links
https://docs.qq.com/sheet/DTkRSaWhSZXBlaldN?tab=000008&_t=1711087563249
(No.16)
parent
93eaef2b
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
18 deletions
+14
-18
ExcelUtil.java
.../java/com/yeejoin/equipmanage/common/utils/ExcelUtil.java
+1
-1
WordConverterUtils.java
.../yeejoin/equipmanage/common/utils/WordConverterUtils.java
+1
-1
WordConverterUtils.java
...m/yeejoin/precontrol/common/utils/WordConverterUtils.java
+1
-1
WordConverterUtils.java
...va/com/yeejoin/amos/fas/core/util/WordConverterUtils.java
+1
-1
SocketClient.java
...in/amos/boot/module/jcs/biz/audioToText/SocketClient.java
+9
-13
SpeechTranscriberDemo.java
...odule/jcs/biz/audioToText/util/SpeechTranscriberDemo.java
+1
-1
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/utils/ExcelUtil.java
View file @
0b5beb36
...
...
@@ -88,7 +88,7 @@ public class ExcelUtil
}
public
static
void
createXSSFExcel
(
String
path
,
String
fileName
,
List
<
String
>
headers
,
List
<
List
<
String
>>
dataList
)
{
File
file
=
new
File
(
path
+
"\\"
+
fileName
);
File
file
=
new
File
(
path
+
File
.
separator
+
fileName
);
if
(!
file
.
isDirectory
())
{
file
.
mkdirs
();
}
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-equip-api/src/main/java/com/yeejoin/equipmanage/common/utils/WordConverterUtils.java
View file @
0b5beb36
...
...
@@ -26,7 +26,7 @@ public class WordConverterUtils {
/**
* 图片存储相对文档路径
*/
private
static
String
imgPath
=
"\\image\\"
;
private
static
String
imgPath
=
File
.
separator
+
"image"
+
File
.
separator
;
/**
* word文档转html文档
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-precontrol-api/src/main/java/com/yeejoin/precontrol/common/utils/WordConverterUtils.java
View file @
0b5beb36
...
...
@@ -24,7 +24,7 @@ public class WordConverterUtils {
/**
* 图片存储相对文档路径
*/
private
static
String
imgPath
=
"\\image\\"
;
private
static
String
imgPath
=
File
.
separator
+
"image"
+
File
.
separator
;
/**
* word文档转html文档
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-fas-biz/src/main/java/com/yeejoin/amos/fas/core/util/WordConverterUtils.java
View file @
0b5beb36
...
...
@@ -26,7 +26,7 @@ public class WordConverterUtils {
/**
* 图片存储相对文档路径
*/
private
static
String
imgPath
=
"\\image\\"
;
private
static
String
imgPath
=
File
.
separator
+
"image"
+
File
.
separator
;
/**
* word文档转html文档
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/audioToText/SocketClient.java
View file @
0b5beb36
...
...
@@ -5,7 +5,6 @@ import org.slf4j.LoggerFactory;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.OutputStream
;
import
java.net.*
;
...
...
@@ -20,9 +19,9 @@ import static com.yeejoin.amos.boot.module.jcs.biz.audioToText.util.SpeechTransc
public
class
SocketClient
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
SocketClient
.
class
);
private
static
final
String
[]
testFilePath
=
{
"C:\\Users\\DELL\\Desktop\\yuyin\\out1.pcm"
,
"C:\\Users\\DELL\\Desktop\\yuyin\\out.pcm"
,
// * 此处写的文件路径地址不要提交到git, 国网电科院SCA扫描会报告为漏洞: 存在“便携性缺陷”
};
private
static
final
String
filePath
=
""
;
// * 此处写的文件路径地址不要提交到git, 国网电科院SCA扫描会报告为漏洞: 存在“便携性缺陷”
public
static
void
main
(
String
[]
args
)
throws
SocketException
{
SocketClient
socketClient
=
new
SocketClient
();
...
...
@@ -35,15 +34,15 @@ public class SocketClient {
if
(
type
>=
testFilePath
.
length
)
type
-=
1
;
try
(
DatagramSocket
datagramSocket
=
new
DatagramSocket
();
FileInputStream
fis
=
new
FileInputStream
(
new
File
(
"C:\\Users\\DELL\\Desktop\\ffmpeg-4.4-full_build-shared\\bin\\out.pcm"
)
);)
{
FileInputStream
fis
=
new
FileInputStream
(
filePath
);)
{
byte
[]
b
=
new
byte
[
1280
];
int
len
;
while
((
len
=
fis
.
read
(
b
))
>
0
)
{
String
logs
=
String
.
format
(
"send data pack length: %s"
,
len
);
String
logs
=
String
.
format
(
"send data pack length: %s"
,
len
);
logger
.
error
(
logs
);
logger
.
error
(
logs
);
datagramSocket
.
send
(
new
DatagramPacket
(
b
,
b
.
length
,
InetAddress
.
getLocalHost
(),
port
));
datagramSocket
.
send
(
new
DatagramPacket
(
b
,
b
.
length
,
InetAddress
.
getLocalHost
(),
port
));
int
deltaSleep
=
getSleepDelta
(
len
,
16000
);
Thread
.
sleep
(
deltaSleep
);
TimeUnit
.
MILLISECONDS
.
sleep
(
100
);
...
...
@@ -60,17 +59,14 @@ public class SocketClient {
if
(
type
>=
testFilePath
.
length
)
type
-=
1
;
try
(
Socket
socket
=
new
Socket
();
FileInputStream
fis
=
new
FileInputStream
(
new
File
(
testFilePath
[
type
])
);)
{
FileInputStream
fis
=
new
FileInputStream
(
testFilePath
[
type
]
);)
{
socket
.
connect
(
new
InetSocketAddress
(
InetAddress
.
getLocalHost
().
getHostAddress
(),
port
));
OutputStream
outputStream
=
socket
.
getOutputStream
();
byte
[]
b
=
new
byte
[
4096
];
int
len
;
while
((
len
=
fis
.
read
(
b
))
>
0
)
{
String
logs
=
String
.
format
(
"send data pack length: %s"
,
len
);
logger
.
error
(
logs
);
String
logs
=
String
.
format
(
"send data pack length: %s"
,
len
);
logger
.
error
(
logs
);
outputStream
.
write
(
b
);
TimeUnit
.
MILLISECONDS
.
sleep
(
200
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/audioToText/util/SpeechTranscriberDemo.java
View file @
0b5beb36
...
...
@@ -220,7 +220,7 @@ public class SpeechTranscriberDemo {
System.exit(-1);
}*/
//本案例使用本地文件模拟发送实时流数据。您在实际使用时,可以实时采集或接收语音流并发送到ASR服务端。
String
filepath
=
"
C:\\Users\\DELL\\Desktop\\ffmpeg-4.4-full_build-shared\\bin\\1839.pcm"
;
String
filepath
=
"
"
;
// * 此处写的文件路径地址不要提交到git, 国网电科院SCA扫描会报告为漏洞: 存在“便携性缺陷”
SpeechTranscriberDemo
demo
=
new
SpeechTranscriberDemo
(
appKey
,
id
,
secret
,
url
);
demo
.
process
(
filepath
);
demo
.
shutdown
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment