11 2019 档案
基于Java API for WebSocket (JSR-356)的标准websocket客户端
摘要:maven依赖 springboot ws.asr.status:ws://172.16.1.238:8888/client/ws/status 他会从这个地址接收服务器状态信息,并且存redis储缓存
阅读全文
Gson反序列json到实体类
摘要:gson在基准测试过程中各项性能接近于Jackson(具体可以看Benchmark of Java JSON libraries)里面的测试, 本人亲测过,实测结果与他的数据一致,Jackson安全性以及性能稳定性毋庸置疑。 笔者当初连续遇到过fastjson多个bug,最终放弃他,投入Jackso
阅读全文
Java合并(连接)多个音频
摘要:java sound resource 合并的说法有歧义,为了方便大家搜索到这里,所以用这个标题,实际上是连接(concat),可以理解为字符串concat方法所指定的含义。 食用方法(从main方法中拷贝出代码来测试): 本地文件如下: 中间生成文件 多个文件合成的文件
阅读全文
判断音频中静音的代码(没测试)
摘要:来源:https://github.com/JorenSix/TarsosDSP/blob/master/src/core/be/tarsos/dsp/SilenceDetector.java
阅读全文
Text Prompted Remote Speaker Authentication : Joint Speech and Speaker Recognition/Verification System :: Major Project ::: Introduction
摘要:转载自:http://ganeshtiwaridotcomdotnp.blogspot.com/2010/12/text-prompted-remote-speaker.html Biometrics is, in the simplest definition, something you are
阅读全文
Speech Recognition Java Code - HMM VQ MFCC ( Hidden markov model, Vector Quantization and Mel Filter Cepstral Coefficient)
摘要:Hi everyone,I have shared speech recognition code inhttps://github.com/gtiwari333/speech-recognition-java-hidden-markov-model-vq-mfccYou can find comp
阅读全文
Java Sound : generate play sine wave - source code
摘要:转载自:http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/java-sound-generate-play-sine-wave.html Working source code example on how to generate and pla
阅读全文
Java Sound : audio inputstream from pcm amplitude array
摘要:转载自:http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/java-sound-making-audio-input-stream.html In this post, i am going to show the code for creati
阅读全文
Silence Removal and End Point Detection MATLAB Code
摘要:转载自:http://ganeshtiwaridotcomdotnp.blogspot.com/2011/08/silence-removal-and-end-point-detection.html Visit http://ganeshtiwaridotcomdotnp.blogspot.com
阅读全文
Java extract amplitude array from recorded wave
摘要:转载自:http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/java-extract-amplitude-array-from.html Extract amplitude array from recorded/saved wav : From
阅读全文
Java Sound Capture from Microphone working code
摘要:转载自:http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/java-sound-capture-from-microphone.html Sound Capture / Record from Microphone and Save : work
阅读全文
Java Audio : Playing PCM amplitude Array
摘要:转载自:http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/java-audio-playing-pcm-amplitude-array.html How to play a array of PCM amplitude values (integ
阅读全文
Sound (audio file) player in java - working source code example
摘要:转载自:http://ganeshtiwaridotcomdotnp.blogspot.com/2011/12/sound-audio-file-player-in-java-working.html Sound (audio file) player in java - working sourc
阅读全文
Silence Removal and End Point Detection JAVA Code(音频删除静音与结束判断)
摘要:转载自:http://ganeshtiwaridotcomdotnp.blogspot.com/2011/08/silence-removal-and-end-point-detection_29.html For the purpose of silence removal of captured
阅读全文
Element 'repository' cannot have character [children], because the type's content type is element-only.
摘要:出错现象 由于代码是网络上拷贝来的,可能存在特殊字符,在进行maven打包的时候报错 [ERROR] Malformed POM F:\ai开放平台\SRC\web知识产权申请\pom.xml: expected START_TAG or END_TAG not TEXT (position: TE
阅读全文
奈奎斯特定理和香农定理
摘要:要搞清楚这两个定理,我们要先弄懂一些术语定义:波特率(baud rate)、比特率(bit rate)、带宽(bandwidth)、容量(capacity)、信噪比、电平等。 波特率 波特率(也称信息传送速率、码元速率、符号速率、或传码率),其定义为每秒钟传送码元的数目,码元速率的单位为“波特”,常
阅读全文
多个wav音频文件合并(连接)成一个文件
摘要:场景:一段声音从浏览器麦克风缓冲上一段一段发给服务器,按照时间戳生成很多文件。 目的:把他们按时间顺序连到一个时间轴上。 命令如下: 最终合(并)成一个out.wav文件 list.txt文件内容: 音频样本
阅读全文
编译安装hls协议切片工具 m3u8-segmenter
摘要:操作系统:Ubuntu16.04.4 amd64 安装http://m3u8-segmenter.inodes.org/方式安装m3u8-segmenter报错,于是有了这篇文章 其中在更新下载源的过程中报错: 笔者的安装方法: 安装截图 centos7安装命令: windows版本 https:/
阅读全文
Jackson解析自定义json到实体类
摘要:json文本 解析方法: 相关实体类
阅读全文
SpringBoot中日志配置
摘要:背景 由于一些框架中还使用log4j-1.x系列陈旧的日志框架,调试过程中有一些错误信息不能在控制台显示,增加了调试成本。以下配置方法 将帮助你获得log4j-1.x日志在控制台显示。 解决方法: 使用logback充当门面模式,由他来适配底层日志框架。 logback-spring.xml(一定要
阅读全文
ThreadLocal Memory Leak in Java web application - Tomcat
摘要:ThreadLocal variables are infamous for creating memory leaks. A memory leak in Java is amount of memory hold by object which are not in use and should
阅读全文
Java Thread Local – How to use and code sample(转)
摘要:转载自:https://veerasundar.com/blog/2010/11/java-thread-local-how-to-use-and-code-sample/ Thread Local is an interesting and useful concept, yet most of
阅读全文
Anti Pattern - ThreadLocal variables with Thread Pool(转)
摘要:In a previous post, I wrote the usage and benefits of ThreadLocal based instance variables in concurrent applications. This seemingly innocent and fai
阅读全文
HLSFFmpegBuilder适用于hls协议的构造器 没具体测试
摘要:import com.google.common.collect.ImmutableList; import net.bramp.ffmpeg.builder.FFmpegBuilder; import java.util.ArrayList; import java.util.List; /*** * 适用于hls协议的构造器,hls协议相关参数 * @author dqk */ ...
阅读全文
一种计算hash的思路
摘要:/*** * 转换请求hash,根据转换模式计算hash,防止重复发送请求,浪费服务器资源(内存、cpu、文件系统等) * @param mode * @param data * @return */ @PerformanceMonitor default String computeHash(ConversionMode mode,byte[]data) { byte[] prefix = mo
阅读全文
JAVA8中接口的一些新用法(springboot环境)
摘要:@Configuration public interface IAbstractConvertStrategy { CacheService getCacheService(); default boolean existedMedia(String uuid) { //重复的解析请求,丢弃 return getCacheS...
阅读全文
带概率的随机生成字符串方法
摘要:package com.demo.uitls; import java.util.Random; /** * 按一定的概率生成一个随机的N位(N>=3)密码,必须由字母数字特殊符号组成,三者缺一不可 * <ul> * <li>数字: 0-9</li> * <li>字母: A-Za-z</li> *
阅读全文
Asynchronous Streaming Request Processing in Spring MVC 4.2 + Spring Boot(SpringBoot中处理异步流请求 SpringMvc4.2以上)
摘要:With the release of Spring 4.2 version, Three new classes have been introduced to handle Requests Asynchronously of the Servlet Thread. Which are; Res
阅读全文
java使用ffmpeg生成HLS切片文件
摘要:最终生成结果 前端代码: 2020-1-7日更新 方法补充:getCacheService().setCacheMap(mediaId, mapping); saveSegments方法 savePlayList方法
阅读全文
保存wave音频流的方法
摘要:保存到文件: 其他方法: 代码来源:https://stackoverflow.com/questions/37281430/how-to-convert-pcm-file-to-wav-or-mp3
阅读全文
纯java代码对音频采样率进行转换
摘要:转换成16KHz采样率(含文件头) 使用方法: 重采样,不保留文件头(通常用于语音识别): 重采样2(不含文件头): 参考来源: https://stackoverflow.com/questions/15410725/java-resample-wav-soundfile-without-thir
阅读全文
使用SampleRateConverter对音频采样率进行转换
摘要:java sound resource SampleRateconverter.java(接近于官方源码) 输入目标采样率,输入文件,输出文件。食用方便;p 比如 SampleRateConverter源码: 笔者在JDK1.8下面测试发现,目标编码还支持PCM_FLOAT(即pcm_f32le)
阅读全文
WebSocket接收音频,并推送到声卡上
摘要:使用信息 StdAudio.java
阅读全文
java使用Sonic 算法对音频变速不变声、变调、调整音量
摘要:依赖库:https://github.com/waywardgeek/sonic 基础库:Sonic.java 1、变速不变音 2、调整音量 3、变调 当然你也可以同时设置 volume,speed,pitch
阅读全文
使用wkhtmltopdf将多个html批量转成pdf
摘要:相关工具:wkhtmltopdf 场景:比如笔者有 ognl中文文档,全部是html,现在想把它转成pdf,放到ipad阅读,文件如下: 下载好wkhtmltox(本地安装目录 D:\develop\wkhtmltox),在该目录下编写脚本convert.bat 执行脚本生成以下文件: 多个pdf合
阅读全文
WAV相关:从PCM16 Little Endian数据转WAV文件
摘要:数据格式 [0.0, -0.0, -0.0, 0.0, 0.0, 0.0, 5.960464477539063e-08, 5.960464477539063e-08, 1.1920928955078125e-07, 1.7881393432617188e-07, 2.384185791015625e
阅读全文
thymeleaf中double/float格式化,四舍五入显示两位小数
摘要:thymeleaf中默认都是调用.toString()方法 转载自:https://blog.csdn.net/t518vs20s/article/details/100038716
阅读全文
thymeleaf中分类信息使用不同的样式
摘要:需求: 相关class类名:S224_on_point url:/notification/list url:/notification/list?type=2 thymeleaf代码如下: thymeleaf中${param.xx}返回的是数组,这一点和jstl不一样,所以此次使用#request
阅读全文
thymeleaf动态拼接class
摘要:场景:站内消息,一些已读的要区别与未读的。 参考来源: https://stackoverflow.com/questions/41480973/thymeleaf-classappend-for-multiple-classes
阅读全文
mysql数据format格式化错误
摘要:错误的语句 错误的结果: 正确的写法: 正确的结果
阅读全文
java中byte数组,二进制binary安装chunk大小读取数据
摘要:每次读取8000字节
阅读全文
python根据数组数据绘图
摘要:转载自网络,版权归原作者所有 hello3.txt文件内部数据如下 。。。。。。7,2,6,-12,-10,-7,-1,2,9,。。。。。。 python脚本 结果
阅读全文
javascript模拟生成uuid
摘要:function guid() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); return v.toString(16); ...
阅读全文
@Qualifier is not applicable for constructor
摘要:问题场景: 笔者在springboot项目中使用java_websocket作为客户端,调用第三方ws服务。 最初只调用一个ws服务,以下代码可以正常工作: 后来又加一个ws服务:ws://2.2.2.2:7777/aaaa 尝试写以下代码报错 正确方法 或者(注意两段代码差别) 最终两个ws正常工
阅读全文
notepad++(NPP)更换主题颜色
摘要:NPP主题网站:https://lonewolfonline.net/notepad-colour-schemes/ 笔者下载了Nord Notepad++ Theme 然后打开%AppData%\Notepad++\目录,新建文件夹theme或者在程序根目录新建theme文件夹 然后再打开note
阅读全文
springboot下jar包方式运行Caused by: java.lang.ExceptionInInitializerError: null
摘要:idea调试过程中不会出现此问题,异常如下 java代码如下: 解决方法: 所有调用SpringUtils.getBean的地方换成以下代码: 参考来源:https://stackoverflow.com/questions/34088780/how-to-get-bean-using-applic
阅读全文
tcpdump抓包代码
摘要:抓出来的包可以导入wireshark分析 以上代码曾经在ios越狱机器上使用,用于抓包,具体也记不起来了 导入wireshark效果
阅读全文
html5调整音频音高
摘要:其他参考:https://stackoverflow.com/questions/53876757/how-to-change-the-pitch-with-javascript
阅读全文
videojs改变音量大小
摘要:音量50% $("#volume").change(function(){ var volume = $(this).val(); $("#volumeLabel").text("x"+volume+"%"); }); var player = videojs('example-video...
阅读全文
videojs调整音频播放语速
摘要:参考来源: https://stackoverflow.com/questions/19112255/change-the-video-playback-speed-using-video-js
阅读全文
javascript从网络下载随机笑话
摘要:/*** * 讲笑话函数(调试用) * @param callback 回调函数 */ function randomText(callback) { var result =''; $.ajax({ type:"get", url:"http://www.mxnzp.c...
阅读全文