pyflac icon indicating copy to clipboard operation
pyflac copied to clipboard

Different instance passed to stream write callback.

Open razed11 opened this issue 7 years ago • 0 comments

IDTest.zip

I'm trying to write some Python code to compress data using a stream rather than a file. When I compress with the flac utility I get very different results than if I compress using a stream in pyFLAC. I posted this question on Stack Overflow.

After some debugging I found that the id() of the encoder passed to the write callback is different from the instance I create. The callback shows one ID for the header data and the last call and a different ID for those in between. Both of these are different from the ID when I first create the object.

Data: is the number of bytes of data passed to the callback. I'm expecting this to be closer to 3 kB.

Squall: ./test.py -f ~/Desktop/short.raw 
ID: 4420179152
Sample Count: 0 Frame: 0 Data: 4
ID: 4420179152
Sample Count: 0 Frame: 0 Data: 38
ID: 4420179152
Sample Count: 0 Frame: 0 Data: 44
Created ID: 4420179088
ID: 4420179216
Sample Count: 3200 Frame: 0 Data: 5640
ID: 4420179216
Sample Count: 3200 Frame: 1 Data: 5787
ID: 4420179216
Sample Count: 3200 Frame: 2 Data: 5710
ID: 4420179216
Sample Count: 3200 Frame: 3 Data: 5716
ID: 4420179216
Sample Count: 3200 Frame: 4 Data: 5699
ID: 4420179216
Sample Count: 3200 Frame: 5 Data: 5608
ID: 4420179216
Sample Count: 3200 Frame: 6 Data: 5643
ID: 4420179216
Sample Count: 3200 Frame: 7 Data: 5445
ID: 4420179216
Sample Count: 3200 Frame: 8 Data: 5532
ID: 4420179152
Sample Count: 3200 Frame: 9 Data: 5552
Total: 56332

razed11 avatar Oct 30 '17 23:10 razed11