Re: WaveIn/WaveOut and sound distortion
From: Phil Taylor (ptaylor_at_private-citizen.com)
Date: 04/06/04
- Previous message: Alexander Grigoriev: "Re: Rip audio from USB CD device?"
- In reply to: Alexander Grigoriev: "Re: WaveIn/WaveOut and sound distortion"
- Next in thread: Bob Masta: "Re: WaveIn/WaveOut and sound distortion"
- Reply: Bob Masta: "Re: WaveIn/WaveOut and sound distortion"
- Reply: John Stewart: "Re: WaveIn/WaveOut and sound distortion"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 6 Apr 2004 08:25:40 -0700
yes, you can only use 1 header in each call.
no, you dont have to unprepare each time to reuse. thats misreading the
docs.
essentially, waveOutPrepareHeader locks the page in addr space so the mem
manager cant move it around. thats all its doing, eg a physical page lock.
and the doc says nothing about this being a one-shot.
"Alexander Grigoriev" <alegr@earthlink.net> wrote in message
news:uKAaD%23qGEHA.712@tk2msftngp13.phx.gbl...
> Yes, you can have a bunch of headers. You can delay unpreparing a header
> and/or prepare it in advance,
> but the thing is that you can only use a prepared header one time. After
> it's done, you have to eventually unprepare it before preparing again for
> waveOutWrite.
>
> "Phil Taylor" <ptaylor@private-citizen.com> wrote in message
> news:uRco5mbGEHA.2428@tk2msftngp13.phx.gbl...
> > no, you prepare a batch of headers at init time, use them, and then
> > unprepare them and end.
> >
> > doing prepare/unprepare in the main loop can cause stalls.
> >
> > I debugged TR II with this problem literally the day it was going gold,
> over
> > the phone, back in '98.
> >
> > "Alexander Grigoriev" <alegr@earthlink.net> wrote in message
> > news:O7jJY1QGEHA.1912@TK2MSFTNGP10.phx.gbl...
> > > You _have_ to unprepare the header every time you're done with it, and
> > > prepare it again for next waveOutWrite.
> > >
> > > "Skaarak" <skaarak@NOakamailSPAM.com> wrote in message
> > > news:WH1bc.168$Ru5.81247@news.uswest.net...
> > > > "William DePalo [MVP VC++]" <willd.no.spam@mvps.org> wrote in
message
> > > > news:ePQcDkDGEHA.3080@tk2msftngp13.phx.gbl...
> > > > > "Skaarak" <skaarak@NOakamailSPAM.com> wrote in message
> > > > > news:aT%ac.155$Ru5.65042@news.uswest.net...
> > > > > > Weird thing is my sound comes out, but its heavily distorted
> (pops,
> > > > > > crackles, quiet) almost like I was over driving the sound and it
> was
> > > > > > compressing it.
> > > > >
> > > > > Check the docs carefully. Your buffers must be prepared, the
buffers
> > > must
> > > > be
> > > > > aligned and they must be sized properly. In addition it is usually
> > wise
> > > to
> > > > > have a handful of them so that you don't suffer from "underrun"
> > (nothing
> > > > > queued up on the output side) or "overrun" (no buffer available on
> the
> > > > input
> > > > > side).
> > > > >
> > > > > In addition, if you use the callback notification mechanism you
must
> > be
> > > > > careful of what you do inside the callback.
> > > > >
> > > >
> > > > I'm using the Callback notification for both, and I was unpreparing
> the
> > > > callback header in the WaveOutCallback, but that was causing
problems
> > > > so I've stop (need to do something different with it though).
> > > >
> > > > All my headers are prepared (WaveInPrepareHeader &
> > WaveOutPrepareHeader).
> > > > An oddity is that on 48000 sample rate, 16 Bits, 2 channel it sounds
> > > great.
> > > > Well, its at least a good chance to be accurate. If I do 8 Bits the
> > sound
> > > > gets
> > > > distorted again, and at 24 bits I hear nothing.
> > > > If I understand it all correctly, I'm acquiring about 10 "samples"
> > before
> > > I
> > > > shove them out the WaveOut line. (Each sample is 256 samples each
> > > > channel)
> > > >
> > > > -Cory
> > > > ps. Do you have to unprepare a WaveOut header once your are done
with
> > > > it or can you just 'free' the data & memory?
> > > >
> > > >
> > >
> > >
> >
> >
>
>
- Previous message: Alexander Grigoriev: "Re: Rip audio from USB CD device?"
- In reply to: Alexander Grigoriev: "Re: WaveIn/WaveOut and sound distortion"
- Next in thread: Bob Masta: "Re: WaveIn/WaveOut and sound distortion"
- Reply: Bob Masta: "Re: WaveIn/WaveOut and sound distortion"
- Reply: John Stewart: "Re: WaveIn/WaveOut and sound distortion"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|