Skip to content

Commit

Permalink
Add a convenience method for saving audio files to disk
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnVinyard committed Jul 7, 2018
1 parent 20dcd86 commit 1190a8d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zounds/timeseries/audiosamples.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,7 @@ def encode(self, flo=None, fmt='WAV', subtype='PCM_16'):
f.write(self)
flo.seek(0)
return flo

def save(self, filename, fmt='WAV', subtype='PCM_16'):
with open(filename, 'wb') as f:
self.encode(f, fmt=fmt, subtype=subtype)

0 comments on commit 1190a8d

Please sign in to comment.