简体   繁体   English

当一个是无声mp3时串联Java中的mp3文件

[英]Concatenate mp3 files in java when one is a silent mp3

I am trying to join two mp3's using java SequenceInputStream in Eclipse. 我正在尝试在Eclipse中使用java SequenceInputStream加入两个mp3。 It works fine if both are regular mp3 with sound. 如果两个都是带有声音的常规mp3,效果很好。 But if there is a blank mp3 with no sound in the series, it overrides the previous mp3, and also doesn't show up as a silent break in final output. 但是,如果系列中没有声音的空白mp3,它会覆盖之前的mp3,也不会在最终输出中显示为无声休息。 Could the overwriting be because of some header issue? 覆盖可能是由于某些标头问题引起的吗? and how can I get a blank silence at the end of the mp3? 以及如何在mp3末尾保持沉默?

You would have to convert your mp3 to a PCM data format (ex : wav) 您必须将mp3转换为PCM数据格式(例如:wav)

Then take mesures to determine if it's a silence : 然后确保确定这是否是沉默:

Calculate the dB or RMS value for a group of sound frames and decide at what level it is considered to be 'silence'. 计算一组声音帧的dBRMS值,并确定将其视为“静音”的级别。

see this thread and also this one for further details 看到这个线程这样一个进一步的细节

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM