User Tools

Site Tools


find_audio_track_length

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

find_audio_track_length [2019/02/08 23:31]
find_audio_track_length [2017/11/11 22:47] (current)
Line 1: Line 1:
 +===== Finding Out the Length of An Audio Track =====
  
 +by Rill
 +
 +If you want to find out the length of an audio track from the command line, there are at least two ways to do this.
 +
 +  * Open a terminal "​Ctrl+Alt+t"​ or or open a console "​Ctrl+Alt+F1-F6"​.
 +
 +==== Use ecasound ====
 +
 +You will need to have the package "​ecasound"​ installed.
 +
 +<​code>​
 +sudo apt-get update
 +sudo apt-get install ecasound
 +</​code>​
 +
 +  * Type the following command, substituting your actual file name for "​file_name"​.<​code>​
 +ecalength file_name
 +</​code>​
 +  * Here is an example of your output.<​code>​
 +file_name 904.784s ( 5m4)
 +</​code>​
 +
 +==== Using soxi ====
 +
 +  * **Note:** It may be necessary to install a sox library for mp3 files.<​code>​
 +sudo apt-get update
 +sudo apt-get install libsox-fmt-mp3
 +</​code>​
 +  * Type the following command, substituting file_name for your actual file name.<​code>​
 +soxi file_name | grep Duration
 +</​code>​
 +  * For the same file we used in the "​ecalength"​ command, the output looks like this:<​code>​
 +Duration ​      : 00:15:03.70 = 19926497 samples ~ 67777.2 CDDA sectors
 +</​code>​
 +
 +Storm Dragon and Willem van der Walt contributed to this article.