|
System.IO.Stream sound_stream = new MemoryStream(buffer);
DirectSound.Buffer k = new DirectSound.Buffer sound_stream,applicationDevice);
--------------
Well, the buffer is a byte[] that I record from DirectSoundCapture , Now I want to play this byte[] , I study MSDN know that I should create a Stream
and write buffer in . Then create a SecondaryBuffer to play this Stream , my code is above , but it shows a error such that :
An unhandled exception of type 'System.ArgumentException' occurred in microsoft.directx.directsound.dll
Additional information: Value does not fall within the expected range.
I can't solve this problem , can anyone help me ???
Of course , I can write buffer into file and then open it , but I don't want
to waste time to do this process , I want to play sound form the buffer directly .
If you have a solution or can't understand about my post , please mail to me
j741119@Ethome.net.tw
Thank you for reading this bad grammar article .
I am Craze JmmJ !!! A student from Taiwan who are instrest in Programming.
|
|
|
|
|
JmmJ wrote:
System.IO.Stream sound_stream = new MemoryStream(buffer);
DirectSound.Buffer k = new DirectSound.Buffer sound_stream,applicationDevice);
System.IO.Stream sound_stream = new MemoryStream(buffer);
DirectSound.Buffer k = new DirectSound.Buffer<big>(</big> sound_stream,applicationDevice);
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
I knew that post would catch you.
|
|
|
|
|
.S.Rod. wrote:
I knew that post would catch you.
Yeah, nothin escapes the Code Police
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
OHHHH......... What a terrible bug it is . @@
|
|
|
|
|
I would like to create a help/info documentation for programms like in the VS .NET help.
What is the way to get on to it?
Any links?
Thanks
Stefan
|
|
|
|
|
|
http://ndoc.sourceforge.net/
|
|
|
|
|
Hi,
I'm using MSHTML in my project, as wrapped in Microsoft.mshtml. Does the .NET garbage collection automatically take care of these resources? Can I explicitly dispose of them somehow? I'm a bit concerned that there might be some memory leaks if I create a large DOM tree and then don't dispose of it somehow.
Thanks,
Arun
|
|
|
|
|
1. If you are concerned about memory internals anyhow, may be managed code is not the most adequate language.
2. Marshal.ReleaseComObject(...)
|
|
|
|
|
1. If you are concerned about memory internals anyhow, may be managed code is not the most adequate language.
Yes, that's true, but it's the best language for my task right now.
2. Marshal.ReleaseComObject(...)
Well, I tried that, and I see no indication that the memory is being deallocated.
I also have this code before that -- myObject is IOleObject for the HTMLDocument object I'm using.
const int OLECLOSE_NOSAVE = 1;<br />
myObject.Close(OLECLOSE_NOSAVE);<br />
myObject.SetClientSite(null);<br />
Thanks so much for your time, you are a true Samaritan.
|
|
|
|
|
Arun Bhalla wrote:
Well, I tried that, and I see no indication that the memory is being deallocated.
The best I can do for you is point the url[^] to one of the horses behind the CLR.
Arun Bhalla wrote:
I also have this code before that -- myObject is IOleObject for the HTMLDocument object I'm using
Internet Explorer is known for having leaks. Welcome to the club!
|
|
|
|
|
The subject pretty much says it!
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
What's the question? How? Can?
|
|
|
|
|
As a general rule,
If the .NET API for a given control does not seem to expose the method you are looking for, then make sure to give a look at the WIN32 API for the underlying control.
In the case of RichText controls, you'll find that there is no direct way of selecting a row either.
Which brings to the point you have to build this selection somehow.
The Find methods exposed by the RichText control both search then select text.
Since none of these methods take a line number as parameter, I am afraid you have to build a char range yourself then call
[C#]
public int RichTextBox.Find(
string str,
int start,
int end,
RichTextBoxFinds options
);
The char range can be obtained by doing preliminary Find (with no selection flag) searching the carriage returns or whatever info you might know.
|
|
|
|
|
Hi,
I need to a pointer to an article or web page or something that will help me get started in developing a certain app. Basically, I need to send an email that as user has written and the email message has to show up in the user’s Sent Items folder in MS Outlook. The program is to be deployed on computers with Win2K using Outlook 2000.
I would like to do this in C# but since its Outlook 2000 would I be better off sticking to C++? Any pointers to creating an Outlook 2000 object in C# would be greatly appreciated!
Thanks!
Kevin
|
|
|
|
|
Outlook object model[^].
As said in the pointed page, you have to import the MSOUTL.OLB type-library to bring the wrapped object model into the .NET world.
|
|
|
|
|
Try to search MSDN
http://msdn.microsoft.com
|
|
|
|
|
V. useful outlook resource.
http://www.slipstick.com/index.htm
|
|
|
|
|
I have installed Visual C# on my windows 2000 machine and everything works fine. But when I install it on my Windows XP machine I keep getting the following error. Data Source Locator missing. Re-Install Visual Studio. Now I have gone through this re-install about 5 times and I still get the same error. Do you know of any issues that exist for windows xp that would cause this?
thanks,
William O'Malley
Systems Programmer
|
|
|
|
|
The "MS data source locator component" is the msdasc.dll file. It is installed by both : MDAC run-time, and Windows OS service packs.
If you have installed VS.NET using the appropriate procedure, ie have used the Windows Component Update CD first and still don't have it installed on your system, then my recommendation is to get this file from the net, and copy it in your "program files\common files\system\ole db" folder. Once installed by hand, don't forget to register it (regsvr32 msdasc.dll).
|
|
|
|
|
Hi, my project builds a DLL (for an Explorer Bar), and I'd like to embed a couple icons in it so that I can add it to the IE toolbar. I'd like to be able to access those icons via the standard reference way: "c:\programs\browser.dll,101" refers to the icon in that DLL at that resource slot.
I've created a resX file, and I know the icon resources get packaged into the DLL, but I can't access those icons from an icon editor or elsewhere in Windows, so I don't think the icon resources are being packaged in the usual way that windows expects for Win32 (unmanaged) applications. How can I package Win32 resources in a (managed) C# assembly?
Thanks,
Arun
|
|
|
|
|
This is a tedious task, at least with VS.NET 2002. Don't know if this changes with 2K3 though.
You have to create base64-ed resources and add them in your .resx file.
Then the compiler usually takes the .resx, migrates it to a .resource file and embed it in the output assembly. All this is automatically done unless explicitely told not to.
Amazingly enough, the only way I have found to add base64-ed resources in the .resx file, other than resources explicitely referenced in Form controls, is to do it by code. See the Resource section in MSDN.
|
|
|
|
|
Hmm, I've downloaded a few resource editors, including a couple on codeproject. I'm also stuck with VS.NET 2002 -- I hope 2003 improves some of these things, and I look forward to trying it out.
I know that I've added resources (icons and otherwise) in a .resx file which is then later part of the assembly. However, I don't know a way to refer to that resource in a way that IE might understand when it's reading a registry entry.
IE expects a format like
Icon => "C:\Program Files\BrowserBar\browserbar.dll,101"
in the registry, but as far as I can tell, I can't access the resources in my current assembly that way, but I can browse through the resources using Lutz Roeder's Resourcer, and it's all packages away neatly by class.
|
|
|
|
|
In fact, you need to add the /win32res:xxxx switch in the cmdline when you are using either csc.exe or al.exe. xxxx is the name of a win32 .res resource file (that is, a compiled WIN32 .rc file). This will embed both icons and bitmaps, and icons will appear as standard icons in windows explorer and shell32.
If you need to embed only one icon, then you can use the /win32icon switch instead.
|
|
|
|