Jun-16-2018, 10:18 PM
You have the answer in the link of stack overflow...
The problem is that struct returns a string in python2 and a bytes array in python3. So when str.join tries to concatenate the bytes complains about it.
The solution is just transform the string operations to bytes operations, and change the line 13 of your script for:
The problem is that struct returns a string in python2 and a bytes array in python3. So when str.join tries to concatenate the bytes complains about it.
The solution is just transform the string operations to bytes operations, and change the line 13 of your script for:
# Notice the b to transform the operation in a bytes operation data = b''.join(struct.pack('f', samp) for samp in tone)