Quantcast
Channel: CodeGuru Forums - Visual Basic 6.0 Programming
Viewing all articles
Browse latest Browse all 736

Help! VB6 with DirectSound8 jumps out of sub just before setting BufferBytes.

$
0
0
I am trying to use DirectSound8 to play the interference wave between two sinusoidal tones, 110 and 111 Hz. I would like to record 2.0 seconds worth of this sound, sampled at 11025 samples per second. To do so, I try to set lBufferBytes to the number of samples with the following code:

Dim BB As Long
BB = CLng((intSmpl - intShift) * DsDesc.fxFormat.nBlockAlign)
DsDesc.lBufferBytes = BB

However, the line BB = CLng... never executes. VB6 just jumps out of the sub.

The value of DsDesc.fxFormat.nBlockAlign is 4.
The value of (intSmpl -intShift) is 22050.
Any ideas?

Viewing all articles
Browse latest Browse all 736

Trending Articles