Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to find out a way in Fedora 17 to extract a random second from a given audio file using a console command.

Is there a YUM package that could help me out ?

share|improve this question
up vote 3 down vote accepted

With sox you can edit audio files in command line If you need exactly one second this will extract the second between 00:16 and 00:17

sox input.wav output.wav trim 00:00:16 00:00:01

The first argument of trim is the beginning of the trim and the second its duration.

If you use the command soxi, you can get the duration of your audio file.

If you manage to do a little script which get the duration of your file and take a random number lesser than this duration, I think you're good :)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .