概述
前言
本文提供将音频提升音量的java工具类代码,一如既往的实用主义分享。
Maven依赖
<dependency> <groupId>cn.hutool</groupId> <artifactId>hutool-all</artifactId> <version>5.7.15</version> </dependency> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>31.0.1-jre</version> </dependency> <dependency> <groupId>org.bytedeco</groupId> <artifactId>javacv-platform</artifactId> <version>1.5.5</version> </dependency>
代码
不废话,上代码。
package com.huyi.csdn.tools; import cn.hutool.core.util.IdUtil; import com.google.common.base.Joiner; import com.google.common.base.Splitter; import org.bytedeco.javacpp.Loader; import java.io.File; import java.text.MessageFormat; import java.util.Arrays; import java.util.List; /** * @Program: csdn @ClassName: RaiseVolumeUtil @Author: 剑客阿良_ALiang @Date: 2021-11-25 00:42 @Description: * 提升音量工具 @Version: V1.0 */ public class RaiseVolumeUtil { /** * 通过倍率提升音量 * * @param audioPath 音频地址 * @param outputDir 输出目录 * @return 图片地址 * @throws Exception 异常 */ public static String raiseByRatio(String audioPath, String outputDir, float ratio) throws Exception { List<String> paths = Splitter.on(".").splitToList(audioPath); String ext = paths.get(paths.size() - 1); if (!Arrays.asList("wav", "mp3").contains(ext)) { throw new Exception("format error"); } String resultPath = Joiner.on(File.separator).join(Arrays.asList(outputDir, IdUtil.simpleUUID() + "." + ext)); String ffmpeg = Loader.load(org.bytedeco.ffmpeg.ffmpeg.class); ProcessBuilder builder = new ProcessBuilder( ffmpeg, "-i", audioPath, "-filter:a", MessageFormat.format("volume={0}", String.valueOf(ratio)), resultPath); builder.inheritIO().start().waitFor(); return resultPath; } /** * 通过分贝提升音量 * * @param audioPath 音频地址 * @param outputDir 输出目录 * @return 图片地址 * @throws Exception 异常 */ public static String raiseByDecibel(String audioPath, String outputDir, int decibel) throws Exception { List<String> paths = Splitter.on(".").splitToList(audioPath); String ext = paths.get(paths.size() - 1); if (!Arrays.asList("wav", "mp3").contains(ext)) { throw new Exception("format error"); } String resultPath = Joiner.on(File.separator).join(Arrays.asList(outputDir, IdUtil.simpleUUID() + "." + ext)); String ffmpeg = Loader.load(org.bytedeco.ffmpeg.ffmpeg.class); ProcessBuilder builder = new ProcessBuilder( ffmpeg, "-i", audioPath, "-filter:a", MessageFormat.format("volume={0}dB", String.valueOf(decibel)), resultPath); builder.inheritIO().start().waitFor(); return resultPath; } }
代码说明
1、raiseByRatio和raiseByDecibel两个方法分别是按照音量倍率提升和按照分贝数提升音频,参数均为音频地址、输出目录、倍率(分贝数)。
2、倍率参数为浮点型,分贝参数为int类型。
3、音频后缀校验只有两种,如需添加,可以自行添加。
4、文件名避免重复使用uuid。
验证一下
提供一个查看音频分辨率的命令,命令如下:
ffmpeg -i C:UsersyiDesktop660952057553105332.wav -filter_complex volumedetect -c:v copy -f null C:UsersyiDesktop1.txt
原始音频音量
验证代码
public static void main(String[] args) throws Exception { System.out.println( raiseByRatio("C:/Users/yi/Desktop/660952057553105332.wav", "C:/Users/yi/Desktop/", 2.5f)); System.out.println( raiseByDecibel("C:/Users/yi/Desktop/660952057553105332.wav", "C:/Users/yi/Desktop/", 30)); }
执行结果
E:Javajdk1.8.0_40binjava.exe "-javaagent:E:Program FilesJetBrainsIntelliJ IDEA 2020.1.1libidea_rt.jar=11349:E:Program FilesJetBrainsIntelliJ IDEA 2020.1.1bin" -Dfile.encoding=UTF-8 -classpath E:Javajdk1.8.0_40jrelibcharsets.jar;E:Javajdk1.8.0_40jrelibdeploy.jar;E:Javajdk1.8.0_40jrelibextaccess-bridge-64.jar;E:Javajdk1.8.0_40jrelibextcldrdata.jar;E:Javajdk1.8.0_40jrelibextdnsns.jar;E:Javajdk1.8.0_40jrelibextjaccess.jar;E:Javajdk1.8.0_40jrelibextjfxrt.jar;E:Javajdk1.8.0_40jrelibextlocaledata.jar;E:Javajdk1.8.0_40jrelibextnashorn.jar;E:Javajdk1.8.0_40jrelibextsunec.jar;E:Javajdk1.8.0_40jrelibextsunjce_provider.jar;E:Javajdk1.8.0_40jrelibextsunmscapi.jar;E:Javajdk1.8.0_40jrelibextsunpkcs11.jar;E:Javajdk1.8.0_40jrelibextzipfs.jar;E:Javajdk1.8.0_40jrelibjavaws.jar;E:Javajdk1.8.0_40jrelibjce.jar;E:Javajdk1.8.0_40jrelibjfr.jar;E:Javajdk1.8.0_40jrelibjfxswt.jar;E:Javajdk1.8.0_40jrelibjsse.jar;E:Javajdk1.8.0_40jrelibmanagement-agent.jar;E:Javajdk1.8.0_40jrelibplugin.jar;E:Javajdk1.8.0_40jrelibresources.jar;E:Javajdk1.8.0_40jrelibrt.jar;C:UsersyiIdeaProjectscsdntargetclasses;C:Usersyi.m2repositoryorgspringframeworkbootspring-boot-starter-web2.5.6spring-boot-starter-web-2.5.6.jar;C:Usersyi.m2repositoryorgspringframeworkbootspring-boot-starter2.5.6spring-boot-starter-2.5.6.jar;C:Usersyi.m2repositoryorgspringframeworkbootspring-boot-starter-logging2.5.6spring-boot-starter-logging-2.5.6.jar;C:Usersyi.m2repositorychqoslogbacklogback-classic1.2.6logback-classic-1.2.6.jar;C:Usersyi.m2repositorychqoslogbacklogback-core1.2.6logback-core-1.2.6.jar;C:Usersyi.m2repositoryorgapachelogginglog4jlog4j-to-slf4j2.14.1log4j-to-slf4j-2.14.1.jar;C:Usersyi.m2repositoryorgapachelogginglog4jlog4j-api2.14.1log4j-api-2.14.1.jar;C:Usersyi.m2repositoryorgslf4jjul-to-slf4j1.7.32jul-to-slf4j-1.7.32.jar;C:Usersyi.m2repositoryjakartaannotationjakarta.annotation-api1.3.5jakarta.annotation-api-1.3.5.jar;C:Usersyi.m2repositoryorgyamlsnakeyaml1.28snakeyaml-1.28.jar;C:Usersyi.m2repositoryorgspringframeworkbootspring-boot-starter-json2.5.6spring-boot-starter-json-2.5.6.jar;C:Usersyi.m2repositorycomfasterxmljacksoncorejackson-databind2.12.5jackson-databind-2.12.5.jar;C:Usersyi.m2repositorycomfasterxmljacksoncorejackson-annotations2.12.5jackson-annotations-2.12.5.jar;C:Usersyi.m2repositorycomfasterxmljacksoncorejackson-core2.12.5jackson-core-2.12.5.jar;C:Usersyi.m2repositorycomfasterxmljacksondatatypejackson-datatype-jdk82.12.5jackson-datatype-jdk8-2.12.5.jar;C:Usersyi.m2repositorycomfasterxmljacksondatatypejackson-datatype-jsr3102.12.5jackson-datatype-jsr310-2.12.5.jar;C:Usersyi.m2repositorycomfasterxmljacksonmodulejackson-module-parameter-names2.12.5jackson-module-parameter-names-2.12.5.jar;C:Usersyi.m2repositoryorgspringframeworkbootspring-boot-starter-tomcat2.5.6spring-boot-starter-tomcat-2.5.6.jar;C:Usersyi.m2repositoryorgapachetomcatembedtomcat-embed-core9.0.54tomcat-embed-core-9.0.54.jar;C:Usersyi.m2repositoryorgapachetomcatembedtomcat-embed-el9.0.54tomcat-embed-el-9.0.54.jar;C:Usersyi.m2repositoryorgapachetomcatembedtomcat-embed-websocket9.0.54tomcat-embed-websocket-9.0.54.jar;C:Usersyi.m2repositoryorgspringframeworkspring-web5.3.12spring-web-5.3.12.jar;C:Usersyi.m2repositoryorgspringframeworkspring-beans5.3.12spring-beans-5.3.12.jar;C:Usersyi.m2repositoryorgspringframeworkspring-webmvc5.3.12spring-webmvc-5.3.12.jar;C:Usersyi.m2repositoryorgspringframeworkspring-aop5.3.12spring-aop-5.3.12.jar;C:Usersyi.m2repositoryorgspringframeworkspring-context5.3.12spring-context-5.3.12.jar;C:Usersyi.m2repositoryorgspringframeworkspring-expression5.3.12spring-expression-5.3.12.jar;C:Usersyi.m2repositoryorgspringframeworkbootspring-boot-devtools2.5.6spring-boot-devtools-2.5.6.jar;C:Usersyi.m2repositoryorgspringframeworkbootspring-boot2.5.6spring-boot-2.5.6.jar;C:Usersyi.m2repositoryorgspringframeworkbootspring-boot-autoconfigure2.5.6spring-boot-autoconfigure-2.5.6.jar;C:Usersyi.m2repositoryorgspringframeworkbootspring-boot-configuration-processor2.5.6spring-boot-configuration-processor-2.5.6.jar;C:Usersyi.m2repositoryorgprojectlomboklombok1.18.22lombok-1.18.22.jar;C:Usersyi.m2repositoryorgslf4jslf4j-api1.7.32slf4j-api-1.7.32.jar;C:Usersyi.m2repositoryorgspringframeworkspring-core5.3.12spring-core-5.3.12.jar;C:Usersyi.m2repositoryorgspringframeworkspring-jcl5.3.12spring-jcl-5.3.12.jar;C:Usersyi.m2repositorycnhutoolhutool-all5.7.15hutool-all-5.7.15.jar;C:Usersyi.m2repositorycomgoogleguavaguava31.0.1-jreguava-31.0.1-jre.jar;C:Usersyi.m2repositorycomgoogleguavafailureaccess1.0.1failureaccess-1.0.1.jar;C:Usersyi.m2repositorycomgoogleguavalistenablefuture9999.0-empty-to-avoid-conflict-with-guavalistenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;C:Usersyi.m2repositorycomgooglecodefindbugsjsr3053.0.2jsr305-3.0.2.jar;C:Usersyi.m2repositoryorgcheckerframeworkchecker-qual3.12.0checker-qual-3.12.0.jar;C:Usersyi.m2repositorycomgoogleerrorproneerror_prone_annotations2.7.1error_prone_annotations-2.7.1.jar;C:Usersyi.m2repositorycomgooglej2objcj2objc-annotations1.3j2objc-annotations-1.3.jar;C:Usersyi.m2repositoryorgbytedecojavacv-platform1.5.5javacv-platform-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecojavacv1.5.5javacv-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecoopenblas .3.13-1.5.5openblas-0.3.13-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecoflycapture2.13.3.31-1.5.5flycapture-2.13.3.31-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecolibfreenect .5.7-1.5.5libfreenect-0.5.7-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecolibfreenect2 .2.0-1.5.5libfreenect2-0.2.0-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense1.12.4-1.5.5librealsense-1.12.4-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense22.40.0-1.5.5librealsense2-2.40.0-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecovideoinput .200-1.5.5videoinput-0.200-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5.jar;C:Usersyi.m2repositoryorgopenjfxjavafx-graphics11javafx-graphics-11.jar;C:Usersyi.m2repositoryorgopenjfxjavafx-graphics11javafx-graphics-11-win.jar;C:Usersyi.m2repositoryorgopenjfxjavafx-base11javafx-base-11.jar;C:Usersyi.m2repositoryorgopenjfxjavafx-base11javafx-base-11-win.jar;C:Usersyi.m2repositoryorgbytedecoopenblas-platform .3.13-1.5.5openblas-platform-0.3.13-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecojavacpp-platform1.5.5javacpp-platform-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-android-arm.jar;C:Usersyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-android-arm64.jar;C:Usersyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-android-x86.jar;C:Usersyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-android-x86_64.jar;C:Usersyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-ios-arm64.jar;C:Usersyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-ios-x86_64.jar;C:Usersyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-linux-armhf.jar;C:Usersyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-linux-arm64.jar;C:Usersyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-linux-ppc64le.jar;C:Usersyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-linux-x86.jar;C:Usersyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-linux-x86_64.jar;C:Usersyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-macosx-arm64.jar;C:Usersyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-macosx-x86_64.jar;C:Usersyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-windows-x86.jar;C:Usersyi.m2repositoryorgbytedecojavacpp1.5.5javacpp-1.5.5-windows-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoopenblas .3.13-1.5.5openblas-0.3.13-1.5.5-android-arm.jar;C:Usersyi.m2repositoryorgbytedecoopenblas .3.13-1.5.5openblas-0.3.13-1.5.5-android-arm64.jar;C:Usersyi.m2repositoryorgbytedecoopenblas .3.13-1.5.5openblas-0.3.13-1.5.5-android-x86.jar;C:Usersyi.m2repositoryorgbytedecoopenblas .3.13-1.5.5openblas-0.3.13-1.5.5-android-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoopenblas .3.13-1.5.5openblas-0.3.13-1.5.5-ios-arm64.jar;C:Usersyi.m2repositoryorgbytedecoopenblas .3.13-1.5.5openblas-0.3.13-1.5.5-ios-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoopenblas .3.13-1.5.5openblas-0.3.13-1.5.5-linux-x86.jar;C:Usersyi.m2repositoryorgbytedecoopenblas .3.13-1.5.5openblas-0.3.13-1.5.5-linux-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoopenblas .3.13-1.5.5openblas-0.3.13-1.5.5-linux-armhf.jar;C:Usersyi.m2repositoryorgbytedecoopenblas .3.13-1.5.5openblas-0.3.13-1.5.5-linux-arm64.jar;C:Usersyi.m2repositoryorgbytedecoopenblas .3.13-1.5.5openblas-0.3.13-1.5.5-linux-ppc64le.jar;C:Usersyi.m2repositoryorgbytedecoopenblas .3.13-1.5.5openblas-0.3.13-1.5.5-macosx-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoopenblas .3.13-1.5.5openblas-0.3.13-1.5.5-windows-x86.jar;C:Usersyi.m2repositoryorgbytedecoopenblas .3.13-1.5.5openblas-0.3.13-1.5.5-windows-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoopencv-platform4.5.1-1.5.5opencv-platform-4.5.1-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-android-arm.jar;C:Usersyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-android-arm64.jar;C:Usersyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-android-x86.jar;C:Usersyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-android-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-ios-arm64.jar;C:Usersyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-ios-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-linux-x86.jar;C:Usersyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-linux-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-linux-armhf.jar;C:Usersyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-linux-arm64.jar;C:Usersyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-linux-ppc64le.jar;C:Usersyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-macosx-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-windows-x86.jar;C:Usersyi.m2repositoryorgbytedecoopencv4.5.1-1.5.5opencv-4.5.1-1.5.5-windows-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoffmpeg-platform4.3.2-1.5.5ffmpeg-platform-4.3.2-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-android-arm.jar;C:Usersyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-android-arm64.jar;C:Usersyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-android-x86.jar;C:Usersyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-android-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-linux-x86.jar;C:Usersyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-linux-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-linux-armhf.jar;C:Usersyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-linux-arm64.jar;C:Usersyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-linux-ppc64le.jar;C:Usersyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-macosx-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-windows-x86.jar;C:Usersyi.m2repositoryorgbytedecoffmpeg4.3.2-1.5.5ffmpeg-4.3.2-1.5.5-windows-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoflycapture-platform2.13.3.31-1.5.5flycapture-platform-2.13.3.31-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecoflycapture2.13.3.31-1.5.5flycapture-2.13.3.31-1.5.5-linux-x86.jar;C:Usersyi.m2repositoryorgbytedecoflycapture2.13.3.31-1.5.5flycapture-2.13.3.31-1.5.5-linux-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoflycapture2.13.3.31-1.5.5flycapture-2.13.3.31-1.5.5-linux-armhf.jar;C:Usersyi.m2repositoryorgbytedecoflycapture2.13.3.31-1.5.5flycapture-2.13.3.31-1.5.5-linux-arm64.jar;C:Usersyi.m2repositoryorgbytedecoflycapture2.13.3.31-1.5.5flycapture-2.13.3.31-1.5.5-windows-x86.jar;C:Usersyi.m2repositoryorgbytedecoflycapture2.13.3.31-1.5.5flycapture-2.13.3.31-1.5.5-windows-x86_64.jar;C:Usersyi.m2repositoryorgbytedecolibdc1394-platform2.2.6-1.5.5libdc1394-platform-2.2.6-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5-linux-x86.jar;C:Usersyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5-linux-x86_64.jar;C:Usersyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5-linux-armhf.jar;C:Usersyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5-linux-arm64.jar;C:Usersyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5-linux-ppc64le.jar;C:Usersyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5-macosx-x86_64.jar;C:Usersyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5-windows-x86.jar;C:Usersyi.m2repositoryorgbytedecolibdc13942.2.6-1.5.5libdc1394-2.2.6-1.5.5-windows-x86_64.jar;C:Usersyi.m2repositoryorgbytedecolibfreenect-platform .5.7-1.5.5libfreenect-platform-0.5.7-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecolibfreenect .5.7-1.5.5libfreenect-0.5.7-1.5.5-linux-x86.jar;C:Usersyi.m2repositoryorgbytedecolibfreenect .5.7-1.5.5libfreenect-0.5.7-1.5.5-linux-x86_64.jar;C:Usersyi.m2repositoryorgbytedecolibfreenect .5.7-1.5.5libfreenect-0.5.7-1.5.5-linux-armhf.jar;C:Usersyi.m2repositoryorgbytedecolibfreenect .5.7-1.5.5libfreenect-0.5.7-1.5.5-linux-arm64.jar;C:Usersyi.m2repositoryorgbytedecolibfreenect .5.7-1.5.5libfreenect-0.5.7-1.5.5-linux-ppc64le.jar;C:Usersyi.m2repositoryorgbytedecolibfreenect .5.7-1.5.5libfreenect-0.5.7-1.5.5-macosx-x86_64.jar;C:Usersyi.m2repositoryorgbytedecolibfreenect .5.7-1.5.5libfreenect-0.5.7-1.5.5-windows-x86.jar;C:Usersyi.m2repositoryorgbytedecolibfreenect .5.7-1.5.5libfreenect-0.5.7-1.5.5-windows-x86_64.jar;C:Usersyi.m2repositoryorgbytedecolibfreenect2-platform .2.0-1.5.5libfreenect2-platform-0.2.0-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecolibfreenect2 .2.0-1.5.5libfreenect2-0.2.0-1.5.5-linux-x86.jar;C:Usersyi.m2repositoryorgbytedecolibfreenect2 .2.0-1.5.5libfreenect2-0.2.0-1.5.5-linux-x86_64.jar;C:Usersyi.m2repositoryorgbytedecolibfreenect2 .2.0-1.5.5libfreenect2-0.2.0-1.5.5-macosx-x86_64.jar;C:Usersyi.m2repositoryorgbytedecolibfreenect2 .2.0-1.5.5libfreenect2-0.2.0-1.5.5-windows-x86_64.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense-platform1.12.4-1.5.5librealsense-platform-1.12.4-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense1.12.4-1.5.5librealsense-1.12.4-1.5.5-linux-armhf.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense1.12.4-1.5.5librealsense-1.12.4-1.5.5-linux-arm64.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense1.12.4-1.5.5librealsense-1.12.4-1.5.5-linux-x86.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense1.12.4-1.5.5librealsense-1.12.4-1.5.5-linux-x86_64.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense1.12.4-1.5.5librealsense-1.12.4-1.5.5-macosx-x86_64.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense1.12.4-1.5.5librealsense-1.12.4-1.5.5-windows-x86.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense1.12.4-1.5.5librealsense-1.12.4-1.5.5-windows-x86_64.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense2-platform2.40.0-1.5.5librealsense2-platform-2.40.0-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense22.40.0-1.5.5librealsense2-2.40.0-1.5.5-linux-armhf.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense22.40.0-1.5.5librealsense2-2.40.0-1.5.5-linux-arm64.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense22.40.0-1.5.5librealsense2-2.40.0-1.5.5-linux-x86.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense22.40.0-1.5.5librealsense2-2.40.0-1.5.5-linux-x86_64.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense22.40.0-1.5.5librealsense2-2.40.0-1.5.5-macosx-x86_64.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense22.40.0-1.5.5librealsense2-2.40.0-1.5.5-windows-x86.jar;C:Usersyi.m2repositoryorgbytedecolibrealsense22.40.0-1.5.5librealsense2-2.40.0-1.5.5-windows-x86_64.jar;C:Usersyi.m2repositoryorgbytedecovideoinput-platform .200-1.5.5videoinput-platform-0.200-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecovideoinput .200-1.5.5videoinput-0.200-1.5.5-windows-x86.jar;C:Usersyi.m2repositoryorgbytedecovideoinput .200-1.5.5videoinput-0.200-1.5.5-windows-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoartoolkitplus-platform2.3.1-1.5.5artoolkitplus-platform-2.3.1-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-android-arm.jar;C:Usersyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-android-arm64.jar;C:Usersyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-android-x86.jar;C:Usersyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-android-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-linux-x86.jar;C:Usersyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-linux-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-linux-armhf.jar;C:Usersyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-linux-arm64.jar;C:Usersyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-linux-ppc64le.jar;C:Usersyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-macosx-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-windows-x86.jar;C:Usersyi.m2repositoryorgbytedecoartoolkitplus2.3.1-1.5.5artoolkitplus-2.3.1-1.5.5-windows-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoflandmark-platform1.07-1.5.5flandmark-platform-1.07-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-android-arm.jar;C:Usersyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-android-arm64.jar;C:Usersyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-android-x86.jar;C:Usersyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-android-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-linux-x86.jar;C:Usersyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-linux-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-linux-armhf.jar;C:Usersyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-linux-arm64.jar;C:Usersyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-linux-ppc64le.jar;C:Usersyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-macosx-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-windows-x86.jar;C:Usersyi.m2repositoryorgbytedecoflandmark1.07-1.5.5flandmark-1.07-1.5.5-windows-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoleptonica-platform1.80.0-1.5.5leptonica-platform-1.80.0-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-android-arm.jar;C:Usersyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-android-arm64.jar;C:Usersyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-android-x86.jar;C:Usersyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-android-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-linux-x86.jar;C:Usersyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-linux-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-linux-armhf.jar;C:Usersyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-linux-arm64.jar;C:Usersyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-linux-ppc64le.jar;C:Usersyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-macosx-x86_64.jar;C:Usersyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-windows-x86.jar;C:Usersyi.m2repositoryorgbytedecoleptonica1.80.0-1.5.5leptonica-1.80.0-1.5.5-windows-x86_64.jar;C:Usersyi.m2repositoryorgbytedecotesseract-platform4.1.1-1.5.5tesseract-platform-4.1.1-1.5.5.jar;C:Usersyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-android-arm.jar;C:Usersyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-android-arm64.jar;C:Usersyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-android-x86.jar;C:Usersyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-android-x86_64.jar;C:Usersyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-linux-x86.jar;C:Usersyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-linux-x86_64.jar;C:Usersyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-linux-armhf.jar;C:Usersyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-linux-arm64.jar;C:Usersyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-linux-ppc64le.jar;C:Usersyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-macosx-x86_64.jar;C:Usersyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-windows-x86.jar;C:Usersyi.m2repositoryorgbytedecotesseract4.1.1-1.5.5tesseract-4.1.1-1.5.5-windows-x86_64.jar com.huyi.csdn.tools.RaiseVolumeUtil ffmpeg version 4.3.2 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 10.2.0 (Rev5, Built by MSYS2 project) configuration: --prefix=.. --disable-iconv --disable-opencl --disable-sdl2 --disable-bzlib --disable-lzma --disable-linux-perf --enable-shared --enable-version3 --enable-runtime-cpudetect --enable-zlib --enable-libmp3lame --enable-libspeex --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-openssl --enable-libopenh264 --enable-libvpx --enable-libfreetype --enable-libopus --enable-cuda --enable-cuvid --enable-nvenc --enable-libmfx --enable-w32threads --enable-indev=dshow --target-os=mingw32 --cc='gcc -m64' --extra-cflags=-I../include/ --extra-ldflags=-L../lib/ --extra-libs='-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lgcc_eh -lWs2_32 -lcrypt32 -lpthread -lz -lm -Wl,-Bdynamic -lole32 -luuid' libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 Guessed Channel Layout for Input Stream #0.0 : mono Input #0, wav, from 'C:/Users/yi/Desktop/660952057553105332.wav': Duration: 00:00:12.58, bitrate: 256 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, mono, s16, 256 kb/s Stream mapping: Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native)) Press [q] to stop, [?] for help Output #0, wav, to 'C:/Users/yi/Desktop/398afa61f6614e0086400fbc2197f0d2.wav': Metadata: ISFT : Lavf58.45.100 Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, mono, s16, 256 kb/s Metadata: encoder : Lavc58.91.100 pcm_s16le size= 393kB time=00:00:12.58 bitrate= 256.0kbits/s speed=4.27e+03x video:0kB audio:393kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.019373% C:/Users/yi/Desktop/398afa61f6614e0086400fbc2197f0d2.wav ffmpeg version 4.3.2 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 10.2.0 (Rev5, Built by MSYS2 project) configuration: --prefix=.. --disable-iconv --disable-opencl --disable-sdl2 --disable-bzlib --disable-lzma --disable-linux-perf --enable-shared --enable-version3 --enable-runtime-cpudetect --enable-zlib --enable-libmp3lame --enable-libspeex --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-openssl --enable-libopenh264 --enable-libvpx --enable-libfreetype --enable-libopus --enable-cuda --enable-cuvid --enable-nvenc --enable-libmfx --enable-w32threads --enable-indev=dshow --target-os=mingw32 --cc='gcc -m64' --extra-cflags=-I../include/ --extra-ldflags=-L../lib/ --extra-libs='-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lgcc_eh -lWs2_32 -lcrypt32 -lpthread -lz -lm -Wl,-Bdynamic -lole32 -luuid' libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 Guessed Channel Layout for Input Stream #0.0 : mono Input #0, wav, from 'C:/Users/yi/Desktop/660952057553105332.wav': Duration: 00:00:12.58, bitrate: 256 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, mono, s16, 256 kb/s Stream mapping: Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native)) Press [q] to stop, [?] for help Output #0, wav, to 'C:/Users/yi/Desktop/97d5a2518af44b528f59c45e90f39a2a.wav': Metadata: ISFT : Lavf58.45.100 Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, mono, s16, 256 kb/s Metadata: encoder : Lavc58.91.100 pcm_s16le size= 393kB time=00:00:12.58 bitrate= 256.0kbits/s speed=3.06e+03x video:0kB audio:393kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.019373% C:/Users/yi/Desktop/97d5a2518af44b528f59c45e90f39a2a.wav Process finished with exit code 0
按照倍率的效果如下
差不多精准
按照分贝数效果
稍微更准一点。
到此这篇关于Java 工具类实现音频音量提升的文章就介绍到这了,更多相关Java 音频音量提升内容请搜索靠谱客以前的文章或继续浏览下面的相关文章希望大家以后多多支持靠谱客!
最后
以上就是矮小台灯为你收集整理的Java 工具类实现音频音量提升的全部内容,希望文章能够帮你解决Java 工具类实现音频音量提升所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复