How i can convert user define structure into byte array,or tell me how can i send struct through socket?
pakFari
Posts
-
send structure through socket? -
Voice playing problem in DirectSoundHi, I am developing a voice chat application in DirectSound, when I play the voice on the second pc, my voice seem to me a robot voice,I think I play digital voice on the other end, can anyone solve this problem, I will be thankful to u.i am using stream socket to send the captured voice bytes.
-
Capture Voice using DirectSoundHi, I a trying to capture the voice using direct sound, but it is not working,here is my code can anyone help me, I will be very thankful to him. private void CaptureThread() { MemoryStream inputStream = new MemoryStream(intervalSize); while (button1.Text == "Stop") { bool val=bufferNotifyEvent.WaitOne(); int currentPos; int readPos; captureBuffer.GetCurrentPosition(out currentPos, out readPos); inputStream.Position = 0; captureBuffer.Read(0, inputStream, intervalSize, LockFlag.None); outputBuffer.Write(0, inputStream, intervalSize , LockFlag.None); outputBuffer.Play(0,BufferPlayFlags.Looping); } Stop(); } the above code is the main thread that run to capture the voice, and some initializations are below private void Form1_Load(object sender, System.EventArgs e) { WaveFormat waveFormat; CaptureBufferDescription capBufDesc; BufferPositionNotify[] notifyPositions; bitsPerSample = 8; // 8 bits per sample const int samplesPerSecond = 11025; // 11 KHz const double interval = 1/45f; // Seconds intervalSize = (int) (interval * samplesPerSecond * bitsPerSample / 8); int samplesPerInterval = intervalSize * 8 / bitsPerSample; int bufferSize = intervalSize * 2; captureDevice = new Capture(); waveFormat = new WaveFormat(); waveFormat.BitsPerSample = bitsPerSample; waveFormat.SamplesPerSecond = samplesPerSecond; waveFormat.Channels = 1; waveFormat.AverageBytesPerSecond = bitsPerSample * samplesPerSecond / 8; waveFormat.BlockAlign = (short)(bitsPerSample / 8); waveFormat.FormatTag = WaveFormatTag.Pcm; capBufDesc = new CaptureBufferDescription(); capBufDesc.Format = waveFormat; capBufDesc.BufferBytes = bufferSize; captureBuffer = new CaptureBuffer(capBufDesc, captureDevice); bufferNotify = new Notify(captureBuffer); bufferNotifyEvent = new AutoResetEvent(false); notifyPositions = new BufferPositionNotify[2]; notifyPositions[0] = new BufferPositionNotify(); notifyPositions[0].EventNotifyHandle = bufferNotifyEvent.Handle; notifyPositions[0].Offset = intervalSize - (bitsPerSample / 8); notifyPositions[1] = new BufferPositionNotify(); notifyPositions[1].EventNotifyHandle = bufferNotifyEvent.Handle; notifyPositions[1].Offset = bufferSize - (bitsPerSample / 8); bufferNotify.SetNotificationPositions(notifyPositions); BufferDescription outputBufferDescription; outputDevice = new Device(); outputDevice.SetCooperativeLevel(this, CooperativeLevel.Normal); outputBufferDescription = new BufferDescription(waveFormat); outpu
-
how to create windownotifyIcon is good approch,but i want to copy the idea of MSN,how my window will appear from the botton right corner of my computer screen and display some message. thankx
-
how to create windowthanks for ur reply, will this give me msn like window look, that appear when anyone come online? let me try it. thankx
-
how to create windowi want to write a code for a window, that should be appear at the right bottom corner of the window, where the windows clock is situated, as happen when any new client come online in msn or yahoo massenger, please help me, thanks
-
win32 API or DirectSoundhi,i am using windows xp with service pack-2, i think DirectX should already exist in my system, but anyhow i installed DirectX 9 from CD. but he problem is still there.
-
win32 API or DirectSoundthankyou very much,in my system DirectX is installed but i could not add the reference of Microsoft.DirectX, it gives an error, i search in my system but could not find the DirectX.dll.plz tell me the way to add the reference of DirectX dll, once again thankx for ur reply
-
win32 API or DirectSoundthanks for ur reply, plz tell me windows uses win32 APIz or DirectX for audio purposes ?, and other person should have installed directsound to use my application or my exe file will not bother?.thanks
-
win32 API or DirectSoundtell me one thing plz,i am working on voice chat project, in this case which approch is better (for audio or vedio) 1> using win32 API 2> DirectSound and one more thing ,our windows uses win32 APIz or DirectSound,thanks
-
How to use WaveOut and WaveInhi i want to capture voice using win32 API in C#,but i am facing some problems,specially, how to pass PtrInt structure in waveInAddBuffer,waveOutOpen can anyone help me,i know how to load winmm.dll but can not capture voice. plz help me i will be very thankful to u,just give me a simple example.thanks
-
How to get voice datathankx a lot, i am really thankful to u,actually i am working on voicechat project,for this i have a logic;that input from mic that is temparary stored in Ram, read those bytes and at the same time send to other client,this idea is okay,plz guide me in this way.again thankx,
-
how to get voice datahi,when we speek in Microphone (during chatting)some binary data is stored in the RAM.can any one tell me the way through which i can access those bytes. i will be very thankful to u.
-
How to get voice datahi,when we speek in Microphone (during chatting)some binary data is stored in the RAM.can any one tell me the way through which i can access those bytes. i will be very thankful to u.
-
C# and voice chathi,can anyone tell me a way of voice chat in c#,i will be very thankful to u.
-
voice chat in C#hi,i want to make a voice chatting software in C# can anyone tell me the road map that i should follow, i mean, that tbe things i should know first to develop such a software or what i should know to complete it efficientlly .thankx
-
Gaming Logic in ASP.Nethi, actually i am tring to develop Tic-Tac toe game using ASp.Net, so that it can be played on LAN or atleast one PC using different web pages, can u tell me batter logic to do this.i tried through thread but could not get resultes. plz guid me i will be thankful to u.
-
Gaming Logic in ASP.Nethi,i am developing web game.Two clicnt may play this game. In which i want to change the second player`s page after the complitition of first players turn. can any one give me loginc to do such a task in asp.net using threading or any other logic.(this game will be played on same or different PCs)
-
ASp.Net and Threadingplease reply me soon i shall be thankful to you.
-
ASp.Net and ThreadingHi, please check it out this code; I am trying to monitor an Application[“startGame”] vaiable for this I wrote a class that lie in WebForm1 : System.Web.UI.Page class private void Page_Load(object sender, System.EventArgs e) { Label1.Text=Session["threadCheck"].ToString(); monitorStartGame=Convert.ToInt32(Application["startGame"]); } class myThread { public WebForm1 web; public object obj; public System.EventArgs ex; public void monitor() { while(monitorStartGame != Convert.ToInt32(web.Application["startGame"])) { Thread.Sleep(TimeSpan.FromSeconds(2)); } web.Session["threadCheck"]=100000; web.Page_Load(obj,ex); } } now when I click the button to start monitoring the following code execute static Thread thread; private void Button12_Click(object sender, System.EventArgs e) { myThread th = new myThread(); th.obj = sender; th.ex=e; th.web=this; thread = new Thread(new ThreadStart(th.monitor)); thread.Start(); } >> Now I open another explorer (using same address) and click another button to change the Application variable private void Button13_Click(object sender, System.EventArgs e) { Application["startGame"]=1000; monitorStartGame=12; } but nothing happen on my previous explorer page (even the vale of Application variable is changed now) and if I change the vale through one explorer it works. I tried to explain my problem I think u can trace out the solution, please give me a solution to this problem. thanx