473,386 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Possible problems capturing data with DirectX.DirectSound

Hi,

I want to capture a signal from the sound card (via microphone or line
input) using the DirectX.Sound.CaptureBuffer class. One of the
properties that can be setup prior to capturing is specifying that the
buffer is continous. This means that once the buffer is filled with
data, it wraps around and continues filling the buffer.

Where I see a potential problem has to do with the sampling speed of
the sound card against the speed of the computer.

After being informed that the buffer has now been filled, I only have
so much time to perform the Read method before the buffer begins to
fillup from the start again. If I fail to read in all the bytes from
the buffer before the new samples are read in, I can only assume that
the data being read using the Read method will eventually be overrun by
the process that fills the buffer and will eventually corrupt the older
data I need to read.

It isn't clear to me that this is how the DirectX buffer system really
works. What isn't clear is that when the Read method executes, does it
execute in parallel to the process that DirectX uses to fill the
buffer? If so and suppose the computer is fast enough, would it be safe
to say that the Read process can stay ahead of the DirectX process used
to fill the buffer?

Is there any safe way to prevent the DirectX buffer from being
overwritten?

Ideally I would have thought that internally, DirectX would manage
multiple buffers that are transparent to my calling application. Once
it fills a buffer, it would create a new buffer. My application could
then be running on a slower PC but that would not matter since no
buffer would be overwritten and eventually my application will get all
the data. As far as my application is concerned, it would only see one
buffer while in fact there could be multiple internal buffers.

Thanks for any info,
Johann Blake

Nov 17 '05 #1
0 1639

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Meena | last post by:
Hi, My application should have a audio recording control, which will record the audio input from a user, save the audio input as a Base64string and play it back. What objects should I be using ?...
3
by: Michael | last post by:
I've installed the Directx 9.0 SDK. Can anybody tell me please what assembly should I import so that all its namespaces will be available in the VS.net.. Thanks for your help.
1
by: sirusdv | last post by:
Has anyone been able to record microphone data via C# in any way? I know there is a way with winmm.dll but I have not been able to manage the whole process yet. Any code would be GREATLY...
0
by: jj | last post by:
I want to use Microsoft.DirectX Microsoft.DirectX.Directplay Microsoft.DirectX.DirectSound references in my project. But I could not find them in the assemblies? I have downloaded DirectX 9.0c...
2
by: Ian | last post by:
Does anyone know of a way where you can bind one of the Audio objects from DirectX.AudioVidoPlayback to a DirectX.DirectSound object? I need to do this because I need to be able to play several video...
0
by: Friskusen | last post by:
I'm trying to play/capture sound with objects in the Microsoft.DirectX.DirectSound namespace.. Trying to create a new Buffer object generates the following exception: Anybody know...
0
by: Harvey Cohen | last post by:
Hello all, I have some C# code that implements calls to DirectX.DirectSound. It compiles under both VS .NET 2003 and VS 2005 and runs under VS .NET 2003 and VS 2005 on a Compaq laptop (Windows...
2
by: Pramod | last post by:
How do i capture voice and playback that again? I am working in C# VS.2005 Thanks & Regards, Pramod
1
by: Jovo Mirkovic | last post by:
Hi, We are working on some application in DirectX, and we are using DirectSound, like this Public Sub playSound(ByVal isloop As Boolean, ByVal fileName As String) Try stopSound() sound =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.