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

Re: [pygame] noise added on OGG playback



Thanks very much for the suggestion, I hadn't tried it yet.
It has some effect--when I increase the buffer size to something very
large, say 1024 * 10, the crackling noise is reduced but not
eliminated.  Of course something like that would create much too long
of a delay.

I also tried increasing the quality of the OGG file (less compressed)
but that has no effect at all.

I've attached a modified version of the Screensaw demo from the PyGame
website.  It calls my song at 0 seconds for Critter, and then again at
4.3 seconds for Ant.

I uploaded the song in question to
http://davidtweet.com/noise_test_polka.ogg


-david.


On 9/24/05, Rene Dudfield <renesd@xxxxxxxxx> wrote:
> 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.
> >
>


--
David Tweet
__________________
http://davidtweet.com

Attachment: noise_test_with_screensaw.py
Description: Binary data