Zuzu-Typ/PyWave

seek function does not update self.data_position

HexAndFlex opened this issue · 2 comments

While the seek function does seem to work to navigate around a file, it does not seem to update the data_position pointer. As such PyWave.Tell() provides an incorrect file position.

To recreate..

rb = pw.open(inWav,'r') #open a read only wav file 
print("pos = " + str(rb.tell()))                 # displays                    "Pos =  0"; good
dat1 = rb.read_samples(10)                       #read 10 samples
print("pos = " + str(rb.tell()))                 # displays                    "Pos =  10"; good
rb.seek(10,1)                                    #skip forward 10 samples
print("pos = " + str(rb.tell()))                 # displays                   "Pos =  10"; should display "Pos = 20"

Whoopsie, yeah. That's not how that should be.

Should be fixed now.

Thanks for letting me know!

Also, happy new year! (:

Thanks for the quick fix. HNY to you too.