Advertisement

08.12.2003 at 01:04PM PDT, ID: 20707633
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.0

Overflow Error #6

Asked by JimmyFalcon in Visual Basic Programming

Tags: , ,

Hello.

This error gives me a headache, I have no idea what's causing it.

Ok, this is a program which uses DirectX8 (or, rather, its VB6 wrapper libraries) to playback/record sound.
Everything worked ok, I then decided to add a VU meter to visualize recording process.

I am using a couple of shapes whose size I'm setting dynamically according to the signal level.
Here's the code:

'dscBuf is a DX8 capture buffer

Dim aSample(2) as Integer

dscBuf.GetCurrentPosition capCURS 'retrieve current writing position in the buffer
readPtr = capCURS.lWrite - 8 'step back a couple of samples (16 bit stereo, each sample is 4 bytes)
If readPtr < 0 Then readPtr = 0 ' to avoid error
dscBuf.ReadBuffer readPtr, 4, aSample(0), DSCBLOCK_DEFAULT  'read 4 bytes into the buffer (should result in two integers)

sScale = (1035 / 32768) * 3 'calculate scale, mult by 3 to produce bigger VU level
If sScale * Abs(aSample(0)) > leftVU.Width Then leftVU.Width = sScale * Abs(aSample(0))    ' <<< OVERFLOW ERROR

'only apply new value if new value is larger than current VU value
'I have a timer routine which moves VU's down automatically (to simulate physical VU and make them look realistic)


Ok, now, this code is running fine on my machine. However, when the client runs it on their machine, he's
getting the Overflow Err #6. He has VB6 installed, so I asked him to run the code and he tells me the error occurs
on the line shown above.

It depends on signal level. If he records silence, it's fine. When he starts to sing into his mic, overflow occurs.

I gave a thorough analisys to this and I can't understand what's happening.

Is it possible that DX API puts some erroneous values into the array and when I'm trying to read them as integers an
error occurs?

It does not make sense. Wave format uses signed integers to represent sound levels. 0 is middle level, 32767 is loudest,
-32768 is quietest.

I cannot come up with any explanation. The only thing I can say is on my machine (Due to sound card configuration)
the level never reaches absolute max or absolute min, meaning max value never gets to 32767 and min never gets
to -32768. Level is somehow limited on my machine. On the clients machine, however, it's possible for the level to
reach absolute min and max...

So... Any ideas?

This is very urgent, I will be doing my own research, but if anyone suggest an explanation, or a work around or
just a lead to a working solution, I will grant the points to that person.

Thank you!

Regards,
- Jimmy
Start Free Trial
[+][-]08.12.2003 at 01:06PM PDT, ID: 9133100

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.12.2003 at 01:12PM PDT, ID: 9133146

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.12.2003 at 01:20PM PDT, ID: 9133227

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Visual Basic Programming
Tags: overflow, error, 6
Sign Up Now!
Solution Provided By: Z_Beeblebrox
Participating Experts: 2
Solution Grade: A
 
 
[+][-]08.12.2003 at 01:20PM PDT, ID: 9133230

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.12.2003 at 01:20PM PDT, ID: 9133232

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08.12.2003 at 01:22PM PDT, ID: 9133250

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.12.2003 at 01:26PM PDT, ID: 9133282

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.12.2003 at 01:42PM PDT, ID: 9133412

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.12.2003 at 01:45PM PDT, ID: 9133434

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.12.2003 at 01:51PM PDT, ID: 9133481

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.12.2003 at 02:00PM PDT, ID: 9133571

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.12.2003 at 02:08PM PDT, ID: 9133643

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.12.2003 at 03:02PM PDT, ID: 9134007

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.12.2003 at 03:05PM PDT, ID: 9134027

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32