Script to detect "empty" audio files filled with silence? - audio

I have a large bunch (>1000) of audio files (mp3, can be converted), where many of them are filled with unintentional silence.
I want to detect/delete all those files that contain only silence while keeping file names intact. Of course, listening through them is NOT an option.
All programming languages or solutions welcome. The simpler, the better.
This might be simple or complicated. I promise you, I did my research, but am at a dead-end.

Here is a solution that will Trim any silence from the beginning and end of your mp3 files. You should be able to write a simple script to batch the large amount of files your looking to handle.
dBpoweramp Music Converter (dMC) is free and can batch process audio files and has a DSP Effects plugin which includes:
Trim Silence: remove silence from beginning or end

Related

Tone.js: How do I loop a sound seamlessly?

I've got a short, crossfaded ambient sound clip running on a loop using Tone.js. Trouble is, there's an audible gap between the end of one playback and the beginning of the next.
I know it's possible to achieve a seamlessly crossfaded loop in Howler.js using audio sprites, but I'm not sure how to do it in Tone.js (and I'd rather stick with this library if possible).
Does anybody out there know how to resolve this?
To avoid discontinuities in looped audio, you need to crossfade the end of the loop with the beginning of it. If your program is only working with a fixed set of loops, you can pre-render the crossfade into the clip using an audio editor like Audacity or a DAW like Pro Tools or Reaper.
If you have a general-purpose app that needs to work with user-supplied audio, then you'll need to write code to mix the end of the loop fading out with the beginning of the loop fading in.
Looping seamlessly MP3 tracks is difficult, but not impossible. MP3 files contain an additional padding that is decoded as audio data by decoders. I would recommend one of these two options to work around the paddings:
Prepare seamless MP3 loops with a special software. You can read more about that here: https://www.compuphase.com/mp3/mp3loops.htm
Switch to a different format: AAC (best support in all browsers, but there still might be some issues with paddings, can be overcame), OPUS, OGG. Read more here: https://en.wikipedia.org/wiki/Gapless_playback#Prerequisites

Creating preview audio clips from m4a files

Another post here answered the question of creating 30 second preview clips from WAV audio files (Create mp3 previews from wav and aiff files). My needs slightly overlap, but differing details are beyond my knowledge.
Requirements/Options: clip length; beginning & ending fade length; input filetypes: m4a/AAC/AIFF; output filetype: mp3; kbps (e.g. 192); original files unaltered; suffix new mp3 names with " (Preview)"
Limitations: no uploading of original files to a server (desktop processing); no compiling (unix/Terminal/Bash script only); recursive processing of files in sub-directories
Any/All assistance and advice is welcome.
You'll most likely get the best results with a DAW (digital audio workstation) and an audio file converter.
For a DAW, Reaper comes with a 60 day trial, and it has everything you need to cut the songs where you need and to do fade ins/fade outs, and other effects if you'd like.
www.reaper.fm
Simply use a converter to convert the m4a file to .wav, .mp3 or whatever you prefer, and then if you need it back in m4a, convert it back. I say this because some DAWs can't work with m4a files, but if which ever one you choose to work with can then no conversion is necessary,
There are many options for what DAW and what converter you use, I recommend Reaper for a DAW, and most converters essentially do the same thing, so it doesn't make much of a difference which one you choose.
Hope this helps!

Efficiently generating time index of pre-transcribed speech using it's audio source and open source tools

On TED.com they have transcriptions and they go to the appropriate section of the video when clicking a part of the transcription.
I want to do this for 80 hours of audios and transcriptions I have, on Linux with OSS.
This is the approach I'm thinking:
Start small with a 30 minuite sample
Split the audio up into 2 minute WAV file formatted chunks, even if it breaks words up
Run the phrase spotter from CMU Sphinx's long-audio-aligner on each chunk, with the transcript
Take the time index for identified words/phrases found in each bit and calculate the actual estimated time of the ngrams in the original audio file.
Does this seem like an efficient approach? Has anyone actually done this?
Are there alternate approaches that are worth trying like dumb word counting that may be accurate enough?
You can just feed all your audio and text in a long audio aligner and it will give you the timestamps of the words. Using this timestamps you can jump to the specific word in a file.
I'm not sure why do you want to split your audio or do something else.

Hashing raw audio data

I'm looking for a solution to this task: I want to open any audio file (MP3,FLAC,WAV), then proceed it to the extracted form and hash this data. The thing is: I don't know how to get this extracted audio data. DirectX could do the job, right? And also, I suppose if I have fo example two MP3 files, both 320kbps and only ID3 tags differ and there's a garbage inside on of the files mixed with audio data (MP3 format allows garbage to be inside) and I extract both files, I should get the exactly same audio data, right? I'd only differ if one file is 128 and the other 320, for example. Okay so, the question is, is there a way to use DirectX to get this extracted audio data? I imagine it'd be some function returning byte array or something. Also, it would be handy to just extract whole file without playback. I want to process hundreds of files so 3-10min/s each (if files have to be played at natural speed for decoding) is way worse that one second for each file (only extracting)
I hope my question is understandable.
Thanks a lot for answers,
Aaron
Use http://sox.sourceforge.net/ (multiplatform). It's faster than realtime as you'd like, and it's designed for batch mode much more than DirectX. For example, sox -r 48k -b 16 -L -c 1 in.mp3 out.raw. Loop that over your hundreds of files using whatever scripting language you like (bash, python, .bat, ...).

how to sync a midi file with an audio file

I want to take a classical music piece in .mp3 (or other audio file if necessary) file and take the same music piece in *.midi file. then - I want to synchronize between them so as a result only the midi file would change and the timing of its beat would be synchronized with the .mp3. So lets say - if I would play them both on the same time they would play the same notes synchronizly.
How can I do so?
(I have cubase if the answer might be there...)
It's a tough task because general beat-tracking (follow tempo changes) hasn't yet been figured out.
There's at least one tool that does work though for matching an audio file to a midi file, assuming the audio file is almost identical to the midi file in terms of the score. But I can't remember it's named, never have used it. The place is to ask is the Music Information Retrieval community of scientists:
http://listes.ircam.fr/wws/info/music-ir
For manual mathcing, you can use modern DAW's like Logic, Pro Tools, etc, to help you with this by providing reasonably nice tools to build a detailed tempo-map of the audio file, and then the MIDI file would line right up with it, but it's a tedious task. You'll likely need tempo changes more often than every measure to get a nice alignment - it will be style-dependent.
You could use tools that already exist. For example, if you know the tempo of the mp3, then you could use this page to change the tempo on the midi file.

Resources