Results 1 to 7 of 7

Thread: Using Winsock to send audio custom stream

  1. #1

    Thread Starter
    Addicted Member jastrzebiec's Avatar
    Join Date
    Nov 2010
    Posts
    173

    Using Winsock to send audio custom stream

    Hello,
    I have poor understanding of both.
    1.
    Using SAPI 5 I redirect text-to-speech to CustomStream object which is created the following way:
    Set CustomStream = New SpeechLib.SpCustomStream
    and then SAPI output is redirected to it:
    Set .AudioOutputStream = CustomStream
    I do not understand what really that CustomStream is.

    2.
    Because of that I do not know how to send it to RemotePort using Winsock.
    When I do:
    Winsock1.SendData CustomStream
    I have nothing on receiving end.

    How should I prepare CustomStream to be able to do that?

    Any comments appreciated,
    jas

  2. #2

    Thread Starter
    Addicted Member jastrzebiec's Avatar
    Join Date
    Nov 2010
    Posts
    173

    Re: Using Winsock to send audio custom stream

    Anyone?
    jas

  3. #3
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: Using Winsock to send audio custom stream

    You can't use SpCustomStream until you create and set a BaseStream for it.

    To get data out of it you use the Read method.

    To send the data using a Winsock control you'd probably Read chunks and send them as UDP datagrams. TCP is often not viable because of the delays the network is allowed to introduce. UDP allows datagrams to be dropped when there is network congestion, so your receiver needs to be able to handle that.

    I think you need to work your way through the SAPI documentation.

  4. #4

    Thread Starter
    Addicted Member jastrzebiec's Avatar
    Join Date
    Nov 2010
    Posts
    173

    Re: Using Winsock to send audio custom stream

    Thank you.
    In fact I am using BaseStream.
    Any suggestion on the size of those chunks?
    The total I need to send is worth not more then 30 seconds of tts.
    jas

  5. #5
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: Using Winsock to send audio custom stream

    Usually you wouldn't want UDP datagram fragmentation, so the limit would be the network path MTU size minus the UDP header overhead.

    TCP/IP MTU can be as low as 576 octets ("bytes") while an al-Ethernet network path is usually 1492 or 1500 octets depending on the frame format.

    Perhaps someone else can advise you regarding streaming protocols, my experience with them is limited.

  6. #6

    Thread Starter
    Addicted Member jastrzebiec's Avatar
    Join Date
    Nov 2010
    Posts
    173

    Re: Using Winsock to send audio custom stream

    Thank you for your help.
    I think I can manage now.
    jas
    Last edited by jastrzebiec; Mar 11th, 2011 at 12:13 AM. Reason: Added

  7. #7

    Thread Starter
    Addicted Member jastrzebiec's Avatar
    Join Date
    Nov 2010
    Posts
    173

    Re: Using Winsock to send audio custom stream

    solved
    Last edited by jastrzebiec; Mar 13th, 2011 at 11:15 PM. Reason: solved

Tags for this Thread

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