CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 17

Threaded View

  1. #1
    Join Date
    Jan 2008
    Posts
    8

    Voice over UDP problem

    Hi.

    I am trying to record from waveIn and send that data over UDP to another computer and play it there. Recording short sample work's perfectly (I use API calls waveInOpen, waveInPrepareHeader etc), so that is not the problem.

    Then if I play that recorded short sample using API calls (waveOutOpen, waveOutPrepareHeader etc) it works fine. So that is not the problem also.

    The problem comes when I try to send that voice to another computer using UDP.

    My voice is in User Defined Type "WAVEHDR". So, when I send it, I use this:

    Code:
    Dim bData() As Byte
    ReDim bData(Len(waveHeader)) As Byte
    
    CopyMemory ByVal VarPtr(bData(0)), ByVal VarPtr(waveHeader), Len(waveHeader)
    
     Winsock1.SendData bData
    Then, in another computer it get it using this code:

    Code:
    Dim rc As Long
    Dim dData() As Byte
        
    Winsock1.GetData dData, vbArray + vbByte
        
    CopyMemory ByVal VarPtr(wAlamolo), ByVal VarPtr(dData(0)), Len(wAlamolo)
    wAlamolo is defined as WAVEHDR in that computer.

    When I compare values before and after send, both seems to be fine.
    So, it seems that all values are transferred without any problems.

    But, when I then try to play that data from wAlamolo, I can hear strange noise. Totally strange noise.

    What can be wrong? Any ideas?

    All help are welcome
    Last edited by Stargazers; January 22nd, 2008 at 08:33 AM. Reason: More politically :)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured