[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Creating a stereo sound from an array doubles frequency



Hi Ian, hi Mark,

thanks for the feedback. pre_init and init works for me, as does your
variant. But your error message (that was apparently added after 1.9.1
was released) provided the necessary clue: pygame makes the assumption
that the argument of make_sound is in C-Order. I can reproduce my
"double frequency" problem with your code if I replace:
   sound = pygame.sndarray.make_sound(buf)
with
   sound = pygame.sndarray.make_sound(buf.copy(order='F'))

(Conversely, the problem dissappears in my script if I do
samples.copy(order='C'))

The above code will apparently trigger an error on pygame 1.9.2pre but
with 1.9.1release will result in the odd behaviour I described. The
details of whether the array ends up in Fortran order may also depend
on numpy version, architecture, etc. as a colleague could not
reproduce my problem with pygame1.9.1 under Windows.

Thanks again, best
  Marcel