Christian Klippel wrote:
hi,

Am Sonntag, 23. Februar 2003 19:36 schrieb Yves Degoyon:
btw, haven't you noticed that the sound
is played at a weird speed ( faster that regular
but not resampled ?? ), i still wonder where
this might come from.... mm .... work ahead.

mostly this is because the soundcard has _not_ exactly the samplerate you
request it to have. for example, if you want 44.100 hz, you can get 44.116 hz
instead. this is because most soundcards have an independant oscillator.
it is even possible for two soundcards of the same brand & type to have
different samplerates.

that is, btw, the reason why you cant simply get multichannel sound by using
multiple soundcards .....
mm, i was not thinking of a soundcard problem,
since other way of playing sound files are ok,
palying at the right speed.
it's only the pdp_live~ object which produces
this effect.


another reason might be due to the framerate of the video. samples per second
divided by frames per second must give a non-fractional result. otherwise you
would have a different number of samples each frame. most of the time this
doesnt bother, but some weird ntsc timing (with that 29.xxx fps) can cause
that too.


best (and most used) solution is to split one _video_frame_ of audio into
several chunks (for example. pd's dsp size) and play them either seamlessy,
overlapping or by repeating the last & first sample to fit the needed time
(some kind of very cheap granular synthesis) for one frame in corrospondance
with the soundcards samplerate.

with no corrections to audio playback you will _always_ get out of sync to the
picture soon.

yes, i do agree on these remarks, but as the decoded audio frames
are decoded into a buffer before being played, and not played at once,
this means the audio data __within__ the buffer is already at the wong speed ??
how could i debug that is the real question right now....

thanks for your hints anyway,

cheers,

sevy/yves