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

2010-02-25 Thread Russell Cumins
You have to sacrifice your first born to Cthulhu.

Alternatively you could try
google+pygame+unsubscribe
and
follow the first link.

On 26 February 2010 01:41, D. Hartley  wrote:

> Sorry if this is a stupid question, but how can I unsubscribe?
>
> On Thu, Feb 25, 2010 at 5:18 PM, B W  wrote:
> >
> >
> > On Thu, Feb 25, 2010 at 1:43 PM, Marius Gedminas 
> wrote:
> >>
> >> On Thu, Feb 25, 2010 at 10:37:36AM -0800, James Paige wrote:
> >> > On Thu, Feb 25, 2010 at 10:31:12AM -0800, B W wrote:
> >> > >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.
> >>
> >> Is that a theoretical observation, or can you actually hear the
> >> difference?
> >>
> > Yes, I can hear the difference, especially in high treble fidelity.
> >
> > Well, it is only one song. I will just exclude it from the pick. Thanks
> for
> > the replies.
> >
> > Gumm
> >
>


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

2010-02-25 Thread D. Hartley
Sorry if this is a stupid question, but how can I unsubscribe?

On Thu, Feb 25, 2010 at 5:18 PM, B W  wrote:
>
>
> On Thu, Feb 25, 2010 at 1:43 PM, Marius Gedminas  wrote:
>>
>> On Thu, Feb 25, 2010 at 10:37:36AM -0800, James Paige wrote:
>> > On Thu, Feb 25, 2010 at 10:31:12AM -0800, B W wrote:
>> > >    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.
>>
>> Is that a theoretical observation, or can you actually hear the
>> difference?
>>
> Yes, I can hear the difference, especially in high treble fidelity.
>
> Well, it is only one song. I will just exclude it from the pick. Thanks for
> the replies.
>
> Gumm
>


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

2010-02-25 Thread B W
On Thu, Feb 25, 2010 at 1:43 PM, Marius Gedminas  wrote:

> On Thu, Feb 25, 2010 at 10:37:36AM -0800, James Paige wrote:
> > On Thu, Feb 25, 2010 at 10:31:12AM -0800, B W wrote:
> > >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.
>
> Is that a theoretical observation, or can you actually hear the
> difference?
>
> Yes, I can hear the difference, especially in high treble fidelity.

Well, it is only one song. I will just exclude it from the pick. Thanks for
the replies.

Gumm


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

2010-02-25 Thread Marius Gedminas
On Thu, Feb 25, 2010 at 10:37:36AM -0800, James Paige wrote:
> On Thu, Feb 25, 2010 at 10:31:12AM -0800, B W wrote:
> >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.

Is that a theoretical observation, or can you actually hear the
difference?

> >Does anyone have a recommendation? Are all sounds in an implementation
> >expected to have the same bitrate?
> 
> 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.

If SDL resampled the sound on load, you'd end up with:

  decode vorbis -> resample (mostly lossless) -> play.

If you resample it in advance, you end up with

  decode vorbis -> resample (mostly lossless) -> reencode vorbis
  (lossy!) => decode vorbis -> play

It's not the resampling that B W is trying to avoid, it's the lossy
reencoding.

Marius Gedminas
-- 
(mental note: stop installing red hat. everytime i do so, it takes ages to fix
my system again.)
-- from the sig of Martin H�gman


signature.asc
Description: Digital signature


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

2010-02-25 Thread B W
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


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

2010-02-25 Thread James Paige
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