如何划分的音频文件(MP3或WAV)成无声段较小的 [英] how to divide an audio file (mp3 or wav) into smaller ones at silent segments
问题描述
我有MP3和WAV音频文件。我想将它们分成较小的文件以编程方式。
I have mp3 and wav audio files. I want to divide them into smaller files programmatically.
有没有简单易用的Java库,我可以用它来处理音频文件,寻求无声段,并在无声段某处分割文件?
Is there any easy-to-use Java library I can use to process the audio file, seek the silent segments, and divide the file somewhere in a silent segment?
推荐答案
本页面: HTTP ://www.labbookpages.co.uk/audio/javaWavFiles.html 有WavFile类,你可以用它来读取波形文件(下载链接WavFile.tar.gz在右上角 - WavFile.tar 。广州)。求无声段可以通过经由文件扫描和寻找范围,其中绝对样本值(即忽略符号)的平均比某个阈值低来进行。 MP3文件可能是最容易被转换成先WAV处理,虽然往返段回MP3可能会降低质量。
This page: http://www.labbookpages.co.uk/audio/javaWavFiles.html has WavFile class you can use to read wave files (the download link to WavFile.tar.gz is in the top right corner - WavFile.tar.gz). Seeking the silent segments can be done by scanning through the file and finding ranges where the average of the absolute sample values (i.e. ignoring sign) is lower than a certain threshold. Mp3 files are probably most easily processed by converting to wav first, although round-tripping the segments back to mp3 may degrade quality.
这篇关于如何划分的音频文件(MP3或WAV)成无声段较小的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!