音频格式转换Java代码,以mp3转amr为例

本文介绍了一种使用Java进行音频格式转换的方法,以MP3转AMR为例,通过引入jave库,详细展示了编码过程,并提供了查看支持的编码器和格式的方法。
摘要由CSDN通过智能技术生成
import ws.schild.jave.*;

import java.io.File;

public class VoiceToAmr {
    /**创建maven项目,导入依赖
     <dependency>
     <groupId>ws.schild</groupId>
     <artifactId>jave-all-deps</artifactId>
     <version>2.6.0</version>
     </dependency>
     */
    //程序员是不需要格式工厂的,直接自己写代码解决。算法如果我们写不来,我们可以做调包侠呀。技术都是站在巨人的肩膀上,我调包我快乐!没必要抵触。
    //
    //以MP3转为amr格式举例:

    public static void main(String[] args) {
        System.out.println(m4aToWav());
//        encodingFormats();
//        codec();
    }

    public static boolean m4aToWav() {
        boolean succeeded = true;
        try {
            File source = new File("C:\\Users\\Administrator\\Desktop\\obj_wo3.mp3");
            File target = new File("C:\\Users\\Administrator\\Desktop\\targetnew1.amr");

            //Audio Attributes
            AudioAttributes audio = new AudioAttributes();
//            audio.setCod
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值