Discussion:
waveOut effects
(too old to reply)
Steve Russell
2005-03-21 03:12:18 UTC
Permalink
I have not yet moved to DirectX and am have never succeeded in doing
anything effects with waveXXX, e.g., waveOutSetPitch,
waveOutSetPlaybackRate. My question is, Until I start using DirectX, are
there reliable methods for manipulating sound playback to change pitch
and/or tempo?
Bob Masta
2005-03-21 13:31:33 UTC
Permalink
On Sun, 20 Mar 2005 22:12:18 -0500, "Steve Russell"
Post by Steve Russell
I have not yet moved to DirectX and am have never succeeded in doing
anything effects with waveXXX, e.g., waveOutSetPitch,
waveOutSetPlaybackRate. My question is, Until I start using DirectX, are
there reliable methods for manipulating sound playback to change pitch
and/or tempo?
I think most (all?) Windows systems use sample rate conversion these
days, so you may be able to simply set a different sample rate. Just
ignore the "supported" rates returned by waveOutGetCaps and use
whatever you want; Windows will take care of it from there. (You
may need to fake the values in the WAV header for this.) I have had
no problems doing this even on an old clunker Win95 laptop with a
junky sound chipset, setting sample rates from hundreds of Hertz
to MHz. The output does indeed match the settings.

Best regards,



Bob Masta
dqatechATdaqartaDOTcom

D A Q A R T A
Data AcQuisition And Real-Time Analysis
www.daqarta.com
Chris P. [MVP]
2005-03-21 13:59:28 UTC
Permalink
Post by Bob Masta
On Sun, 20 Mar 2005 22:12:18 -0500, "Steve Russell"
Post by Steve Russell
I have not yet moved to DirectX and am have never succeeded in doing
anything effects with waveXXX, e.g., waveOutSetPitch,
waveOutSetPlaybackRate. My question is, Until I start using DirectX, are
there reliable methods for manipulating sound playback to change pitch
and/or tempo?
I think most (all?) Windows systems use sample rate conversion these
days, so you may be able to simply set a different sample rate. Just
ignore the "supported" rates returned by waveOutGetCaps and use
whatever you want; Windows will take care of it from there. (You
may need to fake the values in the WAV header for this.) I have had
no problems doing this even on an old clunker Win95 laptop with a
junky sound chipset, setting sample rates from hundreds of Hertz
to MHz. The output does indeed match the settings.
waveOutSetPitch & waveOutSetPlaybackRate only ever worked if the hardware
supported it. When WDM audio drivers came along these were more or less
dropped.

If you want to stay with the waveOut interface you change the samplerate as
Bob describes to change the pitch and tempo together. You will have to
reopen the wave device each time you want to change. DirectSound will
allow you to do the same thing but you can make changes on the fly by
calling SetFrequency().

If you need to change pitch and tempo independently then you will have to
write your own time stretching code. Changing tempo without changing pitch
is very difficult especially for music. The WSOLA algorithm is very
effective on voice but artifacts are created in music due to the higher
frequency range.
Steve Russell
2005-03-21 22:08:18 UTC
Permalink
Post by Chris P. [MVP]
Post by Bob Masta
On Sun, 20 Mar 2005 22:12:18 -0500, "Steve Russell"
Post by Steve Russell
I have not yet moved to DirectX and am have never succeeded in doing
anything effects with waveXXX, e.g., waveOutSetPitch,
waveOutSetPlaybackRate. My question is, Until I start using DirectX, are
there reliable methods for manipulating sound playback to change pitch
and/or tempo?
I think most (all?) Windows systems use sample rate conversion these
days, so you may be able to simply set a different sample rate. Just
ignore the "supported" rates returned by waveOutGetCaps and use
whatever you want; Windows will take care of it from there. (You
may need to fake the values in the WAV header for this.) I have had
no problems doing this even on an old clunker Win95 laptop with a
junky sound chipset, setting sample rates from hundreds of Hertz
to MHz. The output does indeed match the settings.
waveOutSetPitch & waveOutSetPlaybackRate only ever worked if the hardware
supported it. When WDM audio drivers came along these were more or less
dropped.
If you want to stay with the waveOut interface you change the samplerate as
Bob describes to change the pitch and tempo together. You will have to
reopen the wave device each time you want to change. DirectSound will
allow you to do the same thing but you can make changes on the fly by
calling SetFrequency().
If you need to change pitch and tempo independently then you will have to
write your own time stretching code. Changing tempo without changing pitch
is very difficult especially for music. The WSOLA algorithm is very
effective on voice but artifacts are created in music due to the higher
frequency range.
Boy, that was easy! Thank you, Bob and Chris!
you zou
2010-05-07 08:20:22 UTC
Permalink
Excuse me, you said "that was easy". Did that mean that you've solved your
problem? How did you do it? I ran into this problem recently and I'd really
appreciate it if you could tell me.

url:http://www.ureader.com/msg/147612.aspx

Continue reading on narkive:
Loading...