Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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