|
In the following code, the size or the array is fixed to 16384 and I made changes to it to get errors. Can someone clearify why it is fixed?
byte[16384]???
private void Start()
{
Stop();
try
{
WaveLib.WaveFormat fmt = new WaveLib.WaveFormat(44100, 16, 2);
m_Player = new WaveLib.WaveOutPlayer(-1, fmt, 16384, 3,
new WaveLib.BufferFillEventHandler(Filler));
m_Recorder = new WaveLib.WaveInRecorder(-1, fmt, 16384, 3,
new WaveLib.BufferDoneEventHandler(DataArrived));
}
catch
{
Stop();
throw;
}
}
private void Voice_In()
{
byte[] br;
r.Bind(new IPEndPoint(IPAddress.Any, int.Parse(this.textBox2.Text)));
while (true)
{
br = new byte[16384];
r.Receive(br);
m_Fifo.Write(br, 0, br.Length);
}
}
|
|
|
|
|
What is WaveLib ? It seems odd that you'd need to use a certain value all the time, perhaps it just must be a power of two ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
As Christian Graus says, without knowing what WaveLib is, we really can't help.
This is just a hunch, but the magic number 16384 is repeated in you code,
have you tried something like this
const int Size = 16384;
private void Start()
{
Stop();
try
{
WaveLib.WaveFormat fmt = new WaveLib.WaveFormat(44100, 16, 2);
m_Player = new WaveLib.WaveOutPlayer(-1, fmt, Size , 3,
new WaveLib.BufferFillEventHandler(Filler));
m_Recorder = new WaveLib.WaveInRecorder(-1, fmt, Size , 3,
new WaveLib.BufferDoneEventHandler(DataArrived));
}
catch
{
Stop();
throw;
}
}
private void Voice_In()
{
byte[] br;
r.Bind(new IPEndPoint(IPAddress.Any, int.Parse(this.textBox2.Text)));
while (true)
{
br = new byte[Size];
r.Receive(br);
m_Fifo.Write(br, 0, br.Length);
}
}
Assuming this works you can then try changing the value of size to suit.
CCC solved so far: 2 (including a Hard One!)
|
|
|
|
|
hi
i build C# program on Windows-Mobile that connect to WebService through cradle
and work with ActiveSync.
the customer want me to change the program that the connection will be through IP cradle.
is it require me any code change ?
how to do it ?
thank's in advance
|
|
|
|
|
I have created some custom control (winform c# .net) that has a "switch" inside it.
Inside it, i've made a propety that "wraps" the switch & allow to toggle it.
Component works fine at run-time, but it sorta nags me it doesn't re-paint the control at runtime when i set the property via property editor.
If i rebuild project, it updates allright, but I wondered if there is any way to make it update as soon as i update the property while still in design-time.
Would appreciate any help on matter.
regards.
|
|
|
|
|
|
Thank you for the fast reply
From a quick look it seems like what i needed. I'll take closer look into the section called "To handle component changes" - as this is what i need in my case.
|
|
|
|
|
Normally calling Invalidate(); inside the property's setter if the value is changing is all that's needed.
Dave
"My code works, but I don't understand why!" - DaveyM69 (Me) BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I'll try that as well. Thank you for your help.
|
|
|
|
|
I know how to pass strings, numbers, and the like back and forth to the embedded WebBrowser in a Windows Form, using InvokeScript and ObjectForScripting, but how does one pass images back and forth into the embedded WebBrowser?
I get empty images on functions that pass images to the HTML document's JavaScript. All the examples I can find show basic number and string passing, but nothing on passing images.
Any information is deeply appreciated.
|
|
|
|
|
You are more likely to get answers if you post this in the Web Development Forum.
If you decide to do that, you should delete this one, to avoid getting moaned at.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Now whom should be moaned at, the poster in the wrong forum, or the replier preventing the deletion of a message?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Hi Luc,
Long time no hear!
Now I do and it's sarcasm all the way.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
have had some kind of medical shutdown, I'm slowly rebooting now.
and yes, my logic powers are still intact.
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
|
|
|
|
Luc Pattyn wrote: have had some kind of medical shutdown,
Sorry to hear that.
Hope you don't BSD before booting completes.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Why would the BSD license be a bad thing?
|
|
|
|
|
I would say his question is in the correct place. It isn't about web development, it's about using the WebBrowser control, a Windows control.
only two letters away from being an asset
|
|
|
|
|
Noted.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I guess, Images will be loaded in web browser whenever you mention proper path in img tag. So no need to send images, rather send its path which corresponds to the image.
|
|
|
|
|
Abhishek Sur wrote: Images will be loaded in web browser whenever you mention proper path in img tag
Umm, I'm not trying to load images from the web or from the file system. I'm wanting to feed them from my desktop application into the embedded WebBrowser control. Basically, I'm trying to feed either an image object or a MemoryStream.
Any ideas out there???
|
|
|
|
|
If you are using .NET web browser control, you might use base64 string for the image. say you have an image, you convert it to base64 and embed it directly in the web browser document.
See the example :
<img
src="data:image/gif;base64,R0lGODlhUAAPAKIAAAsLav///88PD9WqsYmApmZmZtZfYmdakyH5BAQUAP8ALAAAAABQAA8AAAPb
WLrc/jDKSVe4OOvNu/9gqARDSRBHegyGMahqO4R0bQcjIQ8E4BMCQc930JluyGRmdAAcdiigMLVr
ApTYWy5FKM1IQe+Mp+L4rphz+qIOBAUYeCY4p2tGrJZeH9y79mZsawFoaIRxF3JyiYxuHiMGb5KT
kpFvZj4ZbYeCiXaOiKBwnxh4fnt9e3ktgZyHhrChinONs3cFAShFF2JhvCZlG5uchYNun5eedRxM
AF15XEFRXgZWWdciuM8GCmdSQ84lLQfY5R14wDB5Lyon4ubwS7jx9NcV9/j5+g4JADs=
" alt="British Blog Directory" width="80" height="15" />
Just read the image from your desktop application to memorystream, convert it to base64 and feed into the img control inside the web browser document.. .
Hope this is what you are looking for...
|
|
|
|
|
Using Base64 is a great suggestion. I'll try that. It should work as I believe that how images are being Marshalled through the COM interface is what is causing the problem. Strings marshal with no problems.
The embedded WebBrowser will not recognize the data scheme unless the user has IE8 installed, but sending the image as a base64 string should allow me to get the job done.
|
|
|
|
|
Yes Right.. Try that.
|
|
|
|
|
Hello,
does anyone know how I can create buttons in the screen preview in C#?
With screen preview I mean the little screen you see when your pointer is on the program in the taskbar. Any idea's? Windows Media Player uses it, so it is possible.
|
|
|
|
|