- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我在 linux 操作系统上运行我的代码时出现以下异常。这段代码在 windows 操作系统上运行良好。下面是异常和使用的代码。
java.lang.IllegalArgumentException: No line matching interface Clip supporting format PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, 支持big-endian。
AudioFormat format = sourceaudio.getFormat();
format = new AudioFormat(
AudioFormat.Encoding.PCM_SIGNED,
format.getSampleRate(),
format.getSampleSizeInBits() * 2,
format.getChannels(),
format.getFrameSize() * 2,
format.getFrameRate(),
true);
AudioFileFormat.Type targettype = AudioFileFormat.Type.WAVE;
AudioInputStream targetaudiostream = AudioSystem.getAudioInputStream(format, sourceaudio);
sourceaudio.close();
targetaudiostream.close();
System.out.println("55555555");
URL url = new URL("http://localhost:8084/newvideo/PCMfile.wav");
Clip clip = AudioSystem.getClip();
AudioInputStream ais = AudioSystem.getAudioInputStream(url);
clip.open(ais);
System.out.println("seconds: " + (clip.getMicrosecondLength() / 1000000));
最佳答案
当在“设备管理器”中禁用音频设备时,我在 Windows 上遇到了同样的错误。我认为问题是 - 音频设备驱动程序,请尝试更新或重新安装它。
关于java - 在 java 中使用 AudioFormat 播放波形文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2955637/
我正在尝试实现一系列音频文件,这些文件是三星语音记录功能的一部分。 像这样 enter image description here 但是,没有显示实时频谱的信息,但是没有显示上传的音频文件的波形的信
希望从输入中获取特定金色#ad9557(173/255、149/255、87/255)的波形,并具有透明背景/或黑色(如果不可能)。 我目前正在使用此脚本来生成它: command = new Str
这个问题是关于用于回答 this 的代码的线。我使用的是 Nicholas DiPiazza 发布的代码,后来是 Andrew Thompson 的变体。我在这段代码中添加了第二个 AudioWave
这就是我要达到的结果 这是我所做的:https://codepen.io/demedos/pen/gjQNOM HTML 结构: .container .header .page-1
我想在未来用 C# .NET 4.0 中的音频做一些项目,所以我收集了一些用于录音、处理 WAVE 文件等的代码示例。但我没能找到的是: 如何实时(ish)绘制音频波形/频谱图?显然,创建内存位图并将
我已经搜索了很多东西,但是找不到我想要的东西。 有没有办法从一个非常短的音频文件(在我的情况下为1秒mp3)生成简化或平坦的声波图像? 简化可能是错误的术语,但是我的意思是我想要这种输出: 而不是这样
我在使用 MS-s 波形 API 的程序中遇到某种链接错误。我正在使用的代码可以在这里找到:http://www.planet-source-code.com/vb/scripts/ShowCode.
我正在使用 Android 2.3.1 上的 Visualizer 类进行一些音乐分析。我发现 FFT 和波形幅度受设备体积的影响。这意味着,如果用户调低音量,我会收到很少或收不到 FFT 数据。 我
我有两张 png,一张白色,一张红色。 当歌曲不播放时,它应该是白色的,当歌曲播放时,它应该随着歌曲的进行而填充红色,并且当分别向后和向前滑动时,它应该填充红色。 我已经能
像soundcloud和zippyshare1,如何用java生成音频波形图?是否有任何框架或开源库可用于这种情况? 我想生成一个音频波形作为图像,加载轨道后,将加载波形图像。 最佳答案 以 this
是否有一种仅 Java 的方法可以在 JScrollPane 中显示更大的图片?我不想重新发明轮子,而且我已经在 JLabel 技巧中使用 ImageIcon 来显示 32768x400 图像而苦
是否有(某处)用于 Windows 的命令行程序,可以从 MP3/WAV 创建 PNG/JPEG 视觉效果? 编辑: 这是图像应该是什么样子的一个很好的例子。 最佳答案 Sox ,“音频处理的瑞士军刀
我正在开发一个 WebGL 应用程序,它使用来自 soundcloud API 的数据。 我正在尝试使用 ThreeJS 将轨道图稿和波形 PNG 加载到纹理中以放入 Sprite 上。 但是我在 c
我是一名优秀的程序员,十分优秀!