title: Get duration of .wav from sox in python
body: <p>I know how to print the duration of the .wav file using sox at the Linux command.</p>
  
  <pre><code>soxi -D input.wav
  </code></pre>
  
  <p>So I used this syntax in python.</p>
  
  <pre><code>subprocess.call(['soxi', '-D', input.wav])
  </code></pre>
  
  <p>But I'd like to save the duration(seconds) in a variable.
  How do I get it in a variable?</p>
  
  <p>+++++++++++ edit ++++++++++++++</p>
  
  <p>using)</p>
  
  <pre><code>wavduration = subprocess.call(['soxi', '-D', input.wav])
  print(wavduration)
  </code></pre>
  
  <p>output)</p>
  
  <pre><code>4.000000
  0
  </code></pre>
  
  <p>This is not the right way to do it...</p>