Unable to play audio from client
-
Hi all I am developing an Voice Chat Application in WPF..... I used DirectSound For Capturing the Audio. Using WaveFormat I am capturing the audio bytes and sending it over the client..... My client is receiving the Audio Byte...But it is not playing....... Can anyone tell me what will be the reason....... I have written the code for audio capturing in the seperate class, let us say voicechat.cs in that device.SetCooperativeLevel is creating problem... so i have inherited System.windows.forms.Form and used.... the way i used to set cooperative level is correct or not.... if it is not please give me a solution to fix both problems i am facing Thanks in Advance Vayanan
-
Hi all I am developing an Voice Chat Application in WPF..... I used DirectSound For Capturing the Audio. Using WaveFormat I am capturing the audio bytes and sending it over the client..... My client is receiving the Audio Byte...But it is not playing....... Can anyone tell me what will be the reason....... I have written the code for audio capturing in the seperate class, let us say voicechat.cs in that device.SetCooperativeLevel is creating problem... so i have inherited System.windows.forms.Form and used.... the way i used to set cooperative level is correct or not.... if it is not please give me a solution to fix both problems i am facing Thanks in Advance Vayanan
Most application of this ilk actually use ASIO not DirectSound, Skype for instance. Its a much better solution than DirectSound. Also you may want to look into XAudio2 as its replacing DirectSound. Not really a lot we can say without seeing your code. When it comes to audio there are SO SO many things that can go wrong, without seeing code its more or less impossible to help. What audio format are you using? Does the client machine have the neccessary codecs to decode the audio bytes. If I remember correctly during my brief look at DirectSound using window handles was slightlf different than windows forms ...
Jammer Going where everyone here has gone before! :) My Blog
-
Hi all I am developing an Voice Chat Application in WPF..... I used DirectSound For Capturing the Audio. Using WaveFormat I am capturing the audio bytes and sending it over the client..... My client is receiving the Audio Byte...But it is not playing....... Can anyone tell me what will be the reason....... I have written the code for audio capturing in the seperate class, let us say voicechat.cs in that device.SetCooperativeLevel is creating problem... so i have inherited System.windows.forms.Form and used.... the way i used to set cooperative level is correct or not.... if it is not please give me a solution to fix both problems i am facing Thanks in Advance Vayanan
public class RecordUtil
{public IntPtr _IntPtr;
public RecordUtil(IntPtr iptr)
{
_IntPtr=iptr; //IntPtr.Zero
}
}in main window use this--
{
IntPtr source = new WindowInteropHelper(this).Handle;
recorder = new RecordUtil(source); //RecordUtil constructor overloading}