PyGame.Mixer.init() format size = -8 and +16

Issue #292 new
Richard St-Aubin
created an issue

Hi guys, I use pygame.mixer version 1.9.2 in a raspberry pi 2 with uname -a Linux RicPi 4.1.17-v7+ #838 SMP Tue Feb 9 13:15:09 GMT 2016 armv7l GNU/Linux I also use a Tektronic Type 422 oscilloscope connected to my raspberry pi 2 audio jack. When I run this program fg.py using python 2.7.9 program, I received:

================================ RESTART ================================

8 8 -8 32776 16 16 -16 32784 Set (22050, 8, 1) Get (22050, 8, 1) Set (22050, -8, 1) Get (22050, 8, 1) Set (22050, 16, 1) Get (22050, -16, 1) Set (22050, -16, 1) Get (22050, -16, 1) Avg 32767.000000 Amp 32767.000000 Step 0.142800 Size 16 Itemsize 2 Set for play (22050, 16, 1) Get for play (22050, -16, 1) array('H', [32767, 37430, 41999, 46379, 50482, 54225, 57531, 60332, 62573, 64207, 65200, 65534, 65200, 64207, 62573, 60332, 57531, 54225, 50482, 46379, 41999, 37430, 32767, 28104, 23535, 19155, 15052, 11309, 8003, 5202, 2961, 1327, 334, 0, 334, 1327, 2961, 5202, 8003, 11309, 15052, 19155, 23535, 28104]) Stop?

As you can see when I set size=-8 and I get size=+8, and when I set size=16 I get size=-16. Also when I look the signal coming from my audio jack using my oscilloscope, the signal is fine when the set value==get value, but when it is not equal, the signal is not good.

I think your program is trying to tell me that pygame.mixer is not supporting -8 and +16 size format. and you program is setting the best alternative value. This behaivour is not documented anywhere. I'm not sure if it is a bug or a if it is expected.

Richard