how to divide an audio file (mp3 or wav) into smaller ones at silent segments

僤鯓⒐⒋嵵緔 提交于 2019-12-12 02:39:32

问题


I have mp3 and wav audio files. I want to divide them into smaller files programmatically.

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?


回答1:


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.



来源:https://stackoverflow.com/questions/20212691/how-to-divide-an-audio-file-mp3-or-wav-into-smaller-ones-at-silent-segments

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!