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

Re: [pygame] noise added on OGG playback



Hey,
try using the pre_init line below to increase the buffer size.  It
works for reducing noise on other systems.

pygame.mixer.pre_init(44100,-16,2, 1024 * 3)
pygame.init()


Cheers,



On 9/25/05, David Tweet <davidtweet@xxxxxxxxx> wrote:
> I have a problem playing some OGG files with pygame.mixer.music.play():
> When I pass a start position that's not zero into this function, on
> playback of some files (not all), I get noise mixed in with the
> playback of the file for as long as that file continues to play.  The
> noise resembles loud crackle from a vinyl record.
>
> The WAV files were originally 16-bit/44.1kHz, I converted to OGG using
> the same consistent settings in Audacity, and I have called
> pygame.mixer.init(44100).  All the files sound fine played back from a
> zero start position, and some even sound fine with a non-zero start
> position, but others consistently have this problem with a non-zero
> start position.
>
> I've considered that it might have to do with whether the music at the
> specified start position is at a zero crossing (all nearby samples at
> least close to zero amplitude), but no amount of modification of the
> file at the chosen time point was able to remove the noise.  Plus, it
> seems like the worst that ought to happen is that you would hear an
> isolated clipping sound at the beginning of the file (if the
> zero-crossing issue were it).
>
> Can anyone enlighten me somewhat on this?  Has anyone had a similar experience?
>
> Thank you,
> David Tweet.
>