|
-
Mar 1st, 2011, 06:56 PM
#1
Thread Starter
Addicted Member
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
-
Mar 9th, 2011, 04:57 PM
#2
Thread Starter
Addicted Member
Re: Using Winsock to send audio custom stream
-
Mar 9th, 2011, 06:15 PM
#3
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.
-
Mar 10th, 2011, 12:39 PM
#4
Thread Starter
Addicted Member
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
-
Mar 10th, 2011, 02:09 PM
#5
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.
-
Mar 10th, 2011, 05:46 PM
#6
Thread Starter
Addicted Member
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
-
Mar 13th, 2011, 12:06 PM
#7
Thread Starter
Addicted Member
Re: Using Winsock to send audio custom stream
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|