audiostream icon indicating copy to clipboard operation
audiostream copied to clipboard

Python3 support

Open JPfeP opened this issue 5 years ago • 4 comments

Hello,

It seems that audiostream is not yet ready for python3. I tried to fix a few errors but then my knowledge found its limits.

  1. In sources directory, two files have problems with arrays (waves.pyx and puredata.pyx): search for lines like that : buf = array('h', '\x00' * self.chunksize) It seems that this is easy to fix by just adding a 'b': buf = array('h', b'\x00' * self.chunksize) There are a few iterations only of them.

  2. Then in waves.pyx there are a few uses of "next" that is no more valid in python3. I tried to change them with the new syntax but it was not sufficient or proper I am afraid.

JPfeP avatar May 21 '19 21:05 JPfeP

Nice work trying to port it to python3 which is very helpful by the why. If the obj is an iterator the in python2 it will have a next() method but for py3 just use the built in next() Py2 obj.next() Py3 next(obj)

avour avatar Oct 22 '19 01:10 avour

I have managed to fix all the errors for python3 on my local version (I am getting some sound), I am going to push all the changes gradually.

JPfeP avatar Feb 21 '20 22:02 JPfeP

I merged all PR, is it ok for you @JPfeP ?

tito avatar Mar 19 '20 11:03 tito

Hi tito,

Yes, perfecto.

The multisin example would need py3 update too, but I don't have time neither motivation for this. The pd examples work fine.

JPfeP avatar Mar 25 '20 19:03 JPfeP