CaptureBuffer.Read: InvalidOperationException
CaptureBuffer.Read: InvalidOperationException
CaptureBuffer.Read: InvalidOperationException
CaptureBuffer.Read: InvalidOperationException
CaptureBuffer.Read: InvalidOperationException
CaptureBuffer.Read: InvalidOperationException CaptureBuffer.Read: InvalidOperationException CaptureBuffer.Read: InvalidOperationException CaptureBuffer.Read: InvalidOperationException CaptureBuffer.Read: InvalidOperationException CaptureBuffer.Read: InvalidOperationException CaptureBuffer.Read: InvalidOperationException CaptureBuffer.Read: InvalidOperationException
CaptureBuffer.Read: InvalidOperationException CaptureBuffer.Read: InvalidOperationException
CaptureBuffer.Read: InvalidOperationException
Go Back  Xtreme Visual Basic Talk > > > > CaptureBuffer.Read: InvalidOperationException


Reply
 
Thread Tools Display Modes
  #1  
Old 11-03-2006, 12:41 PM
KB3LWJ KB3LWJ is offline
Newcomer
 
Join Date: Nov 2006
Location: Western PA
Posts: 2
Default CaptureBuffer.Read: InvalidOperationException


I've been trying to write a a system-wide audio meter for the DJ software I'm developing, but when I try to read from my CaptureBuffer an InvalidOperationException gets thrown. Any ideas on what could be causing this?

Code:
 Dim tempFrameDelay, tempSampleDelay, leftValue, rightValue, i As Integer
        Dim samples(8, 2, 1) As Integer
        Dim typeArray(2) As Integer
        Dim returnType As System.Type

        returnType = samples.GetType()

        samples.Initialize()

        tempFrameDelay = 100
        tempSampleDelay = 10

        typeArray(0) = 8
        typeArray(1) = 2
        typeArray(2) = 1

        samples = dxCaptureBuffer.Read(0, returnType, Microsoft.DirectX.DirectSound.LockFlag.FromWriteCursor, typeArray)
Derek

Last edited by KB3LWJ; 11-03-2006 at 12:47 PM.
Reply With Quote
  #2  
Old 11-04-2006, 03:49 PM
Moohasha's Avatar
Moohasha Moohasha is offline
Centurion
 
Join Date: Nov 2004
Location: Texas
Posts: 165
Default

This may be a stupid question, but are you creating the object before you use it? I'm not familiar with the CaptureBuffer, so don't know what you need to call, but most DX objects have to be instanciated before they're used, or else you're just referencing memory garbage.
__________________
"The whole trouble comes from the fact that there is so much tinkering with software. It is not made in a clean fabrication process, which it should be. What we need, is software engineering." — F.L. Bauer, 1968
Reply With Quote
  #3  
Old 11-04-2006, 04:05 PM
KB3LWJ KB3LWJ is offline
Newcomer
 
Join Date: Nov 2006
Location: Western PA
Posts: 2
Default

Quote:
Originally Posted by Moohasha
This may be a stupid question, but are you creating the object before you use it? I'm not familiar with the CaptureBuffer, so don't know what you need to call, but most DX objects have to be instanciated before they're used, or else you're just referencing memory garbage.
Yeah, all of that gets done when the form loads....

And anyways, that would result in a NullReferenceException, not an InvalidOperationException.

Derek
Reply With Quote
  #4  
Old 01-02-2007, 01:01 AM
Torvi Torvi is offline
Newcomer
 
Join Date: Aug 2005
Posts: 1
Default

hi, i dont speak too much english so....

Private Shared SAMPLE_FORMAT_ARRAY As Integer() = {SAMPLES, 2, 1}

samplesWave = buffer.Read(0, GetType(Int16), LockFlag.FromWriteCursor, SAMPLE_FORMAT_ARRAY)
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
CaptureBuffer.Read: InvalidOperationException
CaptureBuffer.Read: InvalidOperationException
CaptureBuffer.Read: InvalidOperationException CaptureBuffer.Read: InvalidOperationException
CaptureBuffer.Read: InvalidOperationException
CaptureBuffer.Read: InvalidOperationException
CaptureBuffer.Read: InvalidOperationException CaptureBuffer.Read: InvalidOperationException CaptureBuffer.Read: InvalidOperationException CaptureBuffer.Read: InvalidOperationException CaptureBuffer.Read: InvalidOperationException CaptureBuffer.Read: InvalidOperationException CaptureBuffer.Read: InvalidOperationException
CaptureBuffer.Read: InvalidOperationException
CaptureBuffer.Read: InvalidOperationException
 
CaptureBuffer.Read: InvalidOperationException
CaptureBuffer.Read: InvalidOperationException
 
-->