title: .wav file error : "AttributeError: 'bytes' object has no attribute 'seek'" in python
body: <p>I am trying to loop through a large list of audio files and want to chop them up into 5 second pieces.</p>
  <p>Relevant code for the problem is as below.</p>
  <pre><code>for file in os.listdir(directory):
      
      f = sf.SoundFile(file)
      
      audio_file = AudioSegment.from_file(file, &quot;wav&quot;)
  
  </code></pre>
  <p>I am getting an error: &quot;AttributeError: 'bytes' object has no attribute 'seek'&quot;</p>
  <p>I appreciate the file is in bytes format, but I have attempted to convert it to a string, etc with no luck as I get a permission denied error when I do that.</p>