0

looking for a software for creating a single sample (demo) file of a music albums, i mean:

load for example 12 tracks of an album, and auto split each track into a 15 seconds and merge all samples into one mp3 file. i found a web based software to do this but it not automatically.

Audio Joiner

1

If you are looking for a free program, AudioMove can help, I think. It has batch processing, and has high-quality sample rate conversion to various sample rates.

1

FFMPEG

FFMPEG can, from the command line, or a batch file, grab the first n seconds of a media file, (video or audio), and can merge those splits into a single file, (converting formats if needed).

  • Free, gratis & open source + :-)
  • Cross platform including Windows + :-)
  • Can be used to do a lot more + :-)
  • If you are doing this sort of thing regularly you can put it into a batch or script file + :-)
  • Because it is so powerful there are a lot of options to consider - :-(

Python + MoviePy

Since actually using FFMPEG can be troublesome due to the shear number of options I often suggest using the python library moviepy which wraps FFMPEG up into a much nicer package. Also:

  • Free, gratis & open source :-)
  • Cross platform including Windows :-)
  • Much easier! :-)

To install python for windows

(OS-X and Linux users will most probably already have python installed):

  1. Go to https://www.python.org/
  2. Download the Windows installer
  3. Run the installer & make sure that "Add Python to the Path" is selected and that "install pip" is selected.

To install MoviePy (any platform):

  1. Open a terminal Window
  2. Type pip install moviepy OS-X & Linux uses will have to prefix this with sudo
  3. Wait a few seconds while pip does it's work
  4. Type: py -3-32 -c"from moviepy.editor import *"

The last line will get moviepy to download and install FFMPEG where it expects it to be.

An example moviepy script that will sample the first 15 seconds of all the MP3 files in the current directory would be:

import glob, os
from moviepy.editor import *

outname = "sampler.mp3" # Name to save to
tracklist = "tracklist.txt"  # Would provide an ordered list of filenames
duration = 15  # Duration of each clip in seconds

if os.path.exists(tracklist):
    filelist = open(tracklist).read().split('\n')
else:  # No tracklist
    filelist = glob.glob('*.mp3')  # Get a list of the mp3 files 

if outname in filelist: # Make sure we don't include any existing sampler
    filelist.remove(outname)

# Read the clips in
#clips = [AudioFileClip(fname).set_end(duration) for fname in filelist] # No fade out
clips = [AudioFileClip(fname).set_end(15).audio_fadeout(0.5) for fname in filelist] # Half second fade out at the end of each clip

sampler = concatenate_audioclips(clips) # Concatenate
sampler.write_audiofile(outname)  # Save sampler

print('Finished %d tracks written to %s!" % (len(clips), outname))

Note that, rather than the fade out in the example above, you could interleave your tracks with one that provides a half seconds silence, or even a brief needle being dragged noise, so as to provide a separation between tracks.

If the above is typed into a file called "sampler.py" somewhere on your path, (such as the python scripts directory), you can change directory to any that has your MP3 files, or other formats with small changes to the script above in and simply type sampler.py go generate your sampler.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.