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

Re: [pygame] pygame.mixer.init(frequency=?)



On Thu, Feb 25, 2010 at 10:31:12AM -0800, B W wrote:
>    Howdy.
> 
>    I can't seem to find any clear info on my problem. I'm hoping someone here
>    has dealt with this.
> 
>    I have two songs. One has a bitrate of 48000, the other 44100. If I allow
>    Pygame (SDL mixer) to use the default frequency, the playback speed of the
>    songs is distorted. If I explicitly set the mixer frequency to match a
>    song so it sounds good, the other sounds distorted.
> 
>    Reinitializing the mixer is not a good option. There are other sounds that
>    need to play, and would be interrupted by a reinit. Resampling the songs
>    is not ideal, either, as Vorbis is a lossy format and sound quality is
>    obviously lost in re-sampling.
>
>    Does anyone have a recommendation? Are all sounds in an implementation
>    expected to have the same bitrate?
> 
>    Thanks in advance for any insight. :)
> 
>    Gumm

Even if SDL_mixer was capable of handling this situation, it would still 
have to handle it by resampling. Unless I am greatly mistaken, there is 
no way to avoid resambling in this situation, so it will be better to 
resample in advance, rather than to expect the library to do it at 
runtime.

---
James Paige