Skip to content

Commit

Permalink
fixed whence bug
Browse files Browse the repository at this point in the history
  • Loading branch information
adangert committed Dec 30, 2020
1 parent 4624906 commit fb77ac9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions piaudio.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,12 @@ def Resample(samples):
@functools.lru_cache(maxsize=128)
class Audio:
def __init__(self, fname):
segment = AudioSegment.from_file(fname)
buf = io.BytesIO()
segment.export(buf, 'wav')
buf.seek(0)
self.sample_ = pygame.mixer.Sound(file=buf)
#these are probably not necessary
#segment = AudioSegment.from_file(fname)
#buf = io.BytesIO()
#segment.export(buf, 'wav')
#buf.seek(0)
self.sample_ = pygame.mixer.Sound(file=fname)
self.fname_ = fname

#this will not work for files other than wav at the moment
Expand Down

0 comments on commit fb77ac9

Please sign in to comment.