Re: [AD] sound frequency? |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Thu, 2004-05-06 at 15:46, Ben Davis wrote:
> On my laptop, which has an ESS card of some sort (ES1868?), DOS programs are
> slightly out of tune, usually sharp, and the pitch depends on the frequency
> requested of the card. Windows programs were always in tune. It could be
> something similar in your case.
>
> If you speed sound up, it will sound higher pitched. If you slow it down, it
> will sound lower pitched. That's because pitch increases with the frequency
> of a wave form.
>
> I suspect your ALSA driver is telling applications that it's running at 44100
> Hz, when it's actually running at 45454 Hz. Allegro generates sound suitable
> for playback at 44100 Hz, and then it gets played too fast, at 45454 Hz, so
> it sounds higher pitched.
>
> It's also possible that Allegro is requesting 44100 Hz and getting 45454 Hz,
> and is not smart enough to notice the difference. Anyone feel like
> investigating?
>
> The figure 45454 comes from the early Sound Blasters. It wasn't possible to
> specify a precise frequency, only some value (a period maybe?) with limited
> precision. 45454 was the closest to 44100.
>
Ah, that makes sense. I'm not sure if ALSA or OSS is cheating though:
ALSA OSS
44100 H H
45454 H L
Both ALSA and OSS return the same rate as requested. Still, The "H"
means high pitched, the "L" low pitched. So it could be, there's just
some bug in my OSS driver (which is emulated by ALSA anyway). Still,
replacing the 45454 default with 44100 would make it sound the same in
both cases..
--
Elias Pschernig <elias@xxxxxxxxxx>