Click here to Skip to main content
15,900,725 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Small question re: customized controls in WPF Pin
chaiguy13375-Sep-08 20:06
chaiguy13375-Sep-08 20:06 
GeneralRe: Small question re: customized controls in WPF Pin
Pete O'Hanlon5-Sep-08 22:55
mvePete O'Hanlon5-Sep-08 22:55 
QuestionWPF - Creating Controls Dynamically on a Stack Panel Pin
Jonso4-Sep-08 15:15
Jonso4-Sep-08 15:15 
QuestionHow to enable Context menu for a listbox item. Pin
Aslesh4-Sep-08 6:22
Aslesh4-Sep-08 6:22 
AnswerRe: How to enable Context menu for a listbox item. Pin
Pete O'Hanlon4-Sep-08 8:42
mvePete O'Hanlon4-Sep-08 8:42 
Questionparsing HTML files Pin
swatikavdia3-Sep-08 23:33
swatikavdia3-Sep-08 23:33 
AnswerRe: parsing HTML files Pin
Michael Sync18-Oct-08 22:02
Michael Sync18-Oct-08 22:02 
QuestionAudio conferencing using WCF and WPF Pin
sumantamca3-Sep-08 21:55
sumantamca3-Sep-08 21:55 
Hi!

I am working on audio conferencing using WCF and WPF, Visual Studio 2008, C#, Direct Sound. I capture the sound from microphone using DirectSound. Then I send the Audio stream (in byte[]) to the server and broadcast from there. It is working fine and connected clients receive the response from the server. But when the incoming audio stream is played, an unrecognizable sound is coming.

I simultaneously run two thread for sending data to the server.
Constructor --
public AudioConferencing()
{
  Initialize();
  senderThread = new Thread(new ThreadStart(Send));
  receiverThread = new Thread(new ThreadStart(PlayAudioStream));
}


private void Send() //Send methods is used to send audio stream to the server
{
try
       {
         captureBuffer = new CaptureBuffer(captureBufferDescription, capture);
   CreateNotifyPositions();
	captureBuffer.Start(true);
	bool readFirstBufferPart = true;
	int offset = 0;
	MemoryStream memStream = new MemoryStream(halfBuffer);
       	bStop = false;
         while (!bStop)
         {
            if (bIsSendingActive)
            {
               autoResetEvent.WaitOne();
               captureBuffer.Read(offset, memStream, halfBuffer, LockFlag.None);
               byte[] dataToWrite = memStream.GetBuffer();
               SendAudioEvent(dataToWrite); //Send Audio Stream to server
            }
         }
       }
     catch (Exception ex)
     {
       MessageBox.Show(ex.Message, "VoiceChat-Send ()", MessageBoxButtons.OK);   
     }
     finally
     {
       captureBuffer.Stop();
     }
}

public void StartPlaying(byte[] AudioStream) //This methods When the client machine 
{					//get the audio stream
     playbackBuffer.Write(?, byteDecodedData, LockFlag.None);
     playbackBuffer.Play(?, BufferPlayFlags.Default);
}

BINDING DETAILS --
----------------------------------------------------------------------------------------------------------------------------------------
binding="netTcpBinding"
bindingConfiguration="DuplexBinding"
        <nettcpbinding>
                <binding name="DuplexBinding" receivetimeout="00:00:20" sendtimeout="00:00:10">
                      maxBufferPoolSize="67108864" maxBufferSize="67108864" maxConnections="100"
                      maxReceivedMessageSize="67108864" portSharingEnabled="true">
                      <readerquotas maxstringcontentlength="67108864" maxarraylength="67108864">
                            maxBytesPerRead="67108864" />
                      <reliablesession enabled="true" />
                      <security mode="None" />
                </readerquotas></binding>
          </nettcpbinding>

---------------------------------------------------------------------------------------------------------------------------------------

I want to know how to write the DirectSound playback Buffer - by the audio stream coming from the server and how to track the rate of playing position and write position.


Please give me the complete guideline (any reference website/code).

Thank you.

Sumanta Chatterjee

Web - www.chatterjeesoft.qsh.in

QuestionParsing XML files [modified] Pin
skrajasthan3-Sep-08 21:52
skrajasthan3-Sep-08 21:52 
GeneralRe: Parsing XML files Pin
Pete O'Hanlon14-Sep-08 22:54
mvePete O'Hanlon14-Sep-08 22:54 
Questionreading XML files Pin
swatikavdia3-Sep-08 21:08
swatikavdia3-Sep-08 21:08 
AnswerRe: reading XML files Pin
Michael Sync18-Oct-08 22:08
Michael Sync18-Oct-08 22:08 
QuestionTextbox validation Pin
Aslesh3-Sep-08 4:52
Aslesh3-Sep-08 4:52 
AnswerRe: Textbox validation Pin
Pete O'Hanlon3-Sep-08 10:21
mvePete O'Hanlon3-Sep-08 10:21 
QuestionHow to animate Expander ? Pin
hdv2123-Sep-08 1:17
hdv2123-Sep-08 1:17 
AnswerRe: How to animate Expander ? Pin
Pete O'Hanlon3-Sep-08 1:25
mvePete O'Hanlon3-Sep-08 1:25 
QuestionAbout eml file parsing in silverlight Pin
skrajasthan2-Sep-08 23:58
skrajasthan2-Sep-08 23:58 
QuestionAdvantages of Silver light for user using silver light application ? Pin
King Shez2-Sep-08 21:47
King Shez2-Sep-08 21:47 
QuestionHelp: Audio conferencing using WCF Pin
Jasvinder Kumar Bali2-Sep-08 20:53
Jasvinder Kumar Bali2-Sep-08 20:53 
QuestionSaving a image of WPF form Pin
shazaduh2-Sep-08 10:03
shazaduh2-Sep-08 10:03 
AnswerRe: Saving a image of WPF form Pin
Mark Salsbery2-Sep-08 10:48
Mark Salsbery2-Sep-08 10:48 
QuestionHow to add the custom control in tool box using wpf Pin
bruze2-Sep-08 5:23
bruze2-Sep-08 5:23 
QuestionPassing objects by ref in WPF Pin
copiloto2-Sep-08 4:45
copiloto2-Sep-08 4:45 
QuestionHow to Create Toolbox and Properybox using WPF(C sharp) Pin
bruze2-Sep-08 3:41
bruze2-Sep-08 3:41 
AnswerRe: How to Create Toolbox and Properybox using WPF(C sharp) Pin
Pete O'Hanlon2-Sep-08 4:00
mvePete O'Hanlon2-Sep-08 4:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.