如何在Java中发挥GSM 6.10 COM pressed文件 [英] How to play GSM 6.10 compressed files in Java

查看:183
本文介绍了如何在Java中发挥GSM 6.10 COM pressed文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

能否请你告诉我,code,这些线路如何进行修改,以能够播放一些GSM文件。

Can you please tell me how these lines of code can be modified to be able to play some GSM files.

File audioFile = new File(audioFilePath);
AudioInputStream audioStream = AudioSystem.getAudioInputStream(audioFile);
AudioFormat format = audioStream.getFormat();
AudioFormat format = audioStream.getFormat();
DataLine.Info info = new DataLine.Info(Clip.class, format);
Clip audioClip = (Clip) AudioSystem.getLine(info);
audioClip.open(audioStream);
audioClip.start();
audioClip.close();
audioStream.close();

感谢

推荐答案

您需要安装GSM一个java完善的售后服务提供商。
FFSampledSP 将工作(通过的 FFmpeg的)。

You need to install a java sound service provider for GSM. FFSampledSP would work (via FFmpeg).

安装它,然后才能到一个PCM码流,你可能需要将GSM流转换是这样的:

Install it and then, to get to a PCM stream, you might need to convert the GSM stream like this:

    AudioInputStream gsmStream = AudioSystem.getAudioInputStream(new File("audio.gsm"));
    AudioInputStream pcmStream = AudioSystem.getAudioInputStream(AudioFormat.Encoding.PCM_SIGNED, gsmStream);

限制:FFSampledSP使用本机库和仅适用于Windows和OS X的其他任何平台可能需要相当多的工作。

Limitation: FFSampledSP uses native libraries and is only available for Windows and OS X. Any other platform probably requires quite a bit of work.

另外,你可能想尝试的 GSM 6.10蝾插件

Alternatively, you might want to try the GSM 6.10 tritons plugin.

这篇关于如何在Java中发挥GSM 6.10 COM pressed文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆