Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Unable to play audio from client

Unable to play audio from client

Scheduled Pinned Locked Moved WPF
helpcsharpwpflounge
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vayanan
    wrote on last edited by
    #1

    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

    J J 2 Replies Last reply
    0
    • V 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

      J Offline
      J Offline
      Jammer 0
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • V 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

        J Offline
        J Offline
        Jasvinder Kumar Bali
        wrote on last edited by
        #3

        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

        }

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups