Help - Search - Members - Calendar
Full Version: how PORT property is used?
Skype Community > English > Development, Betas and Skype Garage > Skype Public API
KFC
Hi,

I have a question about property PORT of INPUT/OUTPUT of the CALL object, and was wondering if you could help me with that.

In Skype Voice Access API, the INPUT/OUTPUT property can be "PORT". I can understand Skype can direct the voice to/from the PORT specified , but not sure how exactly PORT is used.

For example, for the PORT of OUTPUT, what is the protocol between Skype and the application listening to that PORT? A TCP connection? What is the format of the data sent to that PORT?

I couldn't find any documentation or examples on this. Could you please help?

Thanks!

KFC
spud5
QUOTE(KFC @ Fri Dec 22 2006, 16:43) [snapback]334728[/snapback]

Hi,

I have a question about property PORT of INPUT/OUTPUT of the CALL object, and was wondering if you could help me with that.

In Skype Voice Access API, the INPUT/OUTPUT property can be "PORT". I can understand Skype can direct the voice to/from the PORT specified , but not sure how exactly PORT is used.

For example, for the PORT of OUTPUT, what is the protocol between Skype and the application listening to that PORT? A TCP connection? What is the format of the data sent to that PORT?

I couldn't find any documentation or examples on this. Could you please help?

Thanks!

KFC


I've not had time to play with audio streaming, but I would suggest that you try something like VLC to stream/record audio using the PORT channel. VLC is quite versatile, so you should be able to determine the data format by testing it.
KFC
QUOTE(spud5 @ Fri Dec 22 2006, 22:48) [snapback]334837[/snapback]

I've not had time to play with audio streaming, but I would suggest that you try something like VLC to stream/record audio using the PORT channel. VLC is quite versatile, so you should be able to determine the data format by testing it.

Thanks for the information! I just tried VLC, however, could not capture anything on the port. Here is what I did:

1) ALTER CALL 58 SET_OUTPUT PORT="1234"
2)In VLC, File-->Open Network Stream, select RTP at port 1234.
3) start

I also tried RTSP and other format, but nothing happened. Then I tried TCP Dump and monitor all the traffics on my machine, and did not find any packets that go to/from 1234.

I found an old post on this forum asking the similar question (https://developer.skype.com/jira/browse/SPA-169), but the answer is not very helpful.

Now I am not sure if this feature is available. Please let me know if you have any idea.

Thanks!

KFC

spud5
QUOTE(KFC @ Mon Dec 25 2006, 16:37) [snapback]335556[/snapback]

Thanks for the information! I just tried VLC, however, could not capture anything on the port. Here is what I did:

1) ALTER CALL 58 SET_OUTPUT PORT="1234"
2)In VLC, File-->Open Network Stream, select RTP at port 1234.
3) start

I also tried RTSP and other format, but nothing happened. Then I tried TCP Dump and monitor all the traffics on my machine, and did not find any packets that go to/from 1234.

I found an old post on this forum asking the similar question (https://developer.skype.com/jira/browse/SPA-169), but the answer is not very helpful.

Now I am not sure if this feature is available. Please let me know if you have any idea.

Thanks!

KFC


I ran a quick test on this and you are right - there was no evidence of Skype creating an audio stream. I ran a trace and it seems that the SET_OUTPUT command was returning FALSE when used with a PORT option.
KFC
Hi spud5,

Don't know why the PORT option is not working. I'll post it on JIRA.

Thanks for taking time and the information!


botastone
hi, i would also like to use the port option, but after quite a lot of tries, i have not managed to make it work. i see, that you also had problems with it 4 months before, and i would like to ask, if you know something new about the topic?
i have also tried VLC, but i have had the same negativ result, as KFC in december.
so, Has anyone ever seen a working skype extra which stream out the voice with ALTER CALL on a port?

thanks
Vlad0
In fact the PORT command is OK, but the correct ritual making it work is like this:

"ALTER CALL 58 SET_OUTPUT SOUNDCARD=\"default\", PORT=\"23456\", FILE=\"file1.wav\"\n"

and/or (if you wish to capture mike as well)

"ALTER CALL 58 SET_CAPTURE_MIC PORT=\"23457\", FILE=\"file2.wav\"\n"

In other words, to set the port one needs simultaneously set SOUNDCARD
(though one can not set here nothing except "default":() and FILE.

Wav files are to be different for audio and mike. If you like the output to be
written in one .wav file, you just merge both .wav files after the call ends.

spud5
QUOTE(Vlad0 @ Mon May 7 2007, 14:40) [snapback]391258[/snapback]

..
In other words, to set the port one needs simultaneously set SOUNDCARD
(though one can not set here nothing except "default":() and FILE.
..

Sorry, I'm not buying that. The "SOUNDCARD", "FILE" and "PORT" are separate entities. If I want to stream audio from VLC to Skype on port 23456 then why would I want to include a FILE="filename" source in the equation? Surely that will attempt to stream the audio from the file into Skype, not just the audio from the VLC stream?
Vlad0
QUOTE(spud5 @ Mon May 7 2007, 14:57) [snapback]391263[/snapback]

Sorry, I'm not buying that. The "SOUNDCARD", "FILE" and "PORT" are separate entities. If I want to stream audio from VLC to Skype on port 23456 then why would I want to include a FILE="filename" source in the equation? Surely that will attempt to stream the audio from the file into Skype, not just the audio from the VLC stream?


In fact I have used these commands to capture calls, not to stream them,
but the experimental fact is that capture failed without inserting
the superfluous SOUNDCARD=\"default\" part to the command string.
And I suspect that streaming failed due to the same reason.

As to the FILE part of the commands above, the files were used to capture sound from
Skype, not to stream it to Skype!

I forget to mention another part of the rituals above":
Before sending any of the above strings to Skype via
SKYPE4COMLib.Command cmd,
I was adding the line

cmd.Blocking = false;

But I do not remember now, whether this additional command
is an essential part of the ritual, or I just forgot to remove it from my source code smile.png
Vlad0
OK, I was wrong. J just tested my code few minutes ago:
there was no packages to the port 23456, no matter whether I compiled with included FILE
part or not. On the other hand, PORT part turns out to be not essential
for successful capture. But without SOUNDCARD part I could not
hear incoming voice, though it is captured into .wav file.

So there seems to be a real bug in ALTER PORT command.
MOSBAHAbdelkader
QUOTE(Vlad0 @ Mon May 7 2007, 16:30) [snapback]391314[/snapback]

OK, I was wrong. J just tested my code few minutes ago:
there was no packages to the port 23456, no matter whether I compiled with included FILE
part or not. On the other hand, PORT part turns out to be not essential
for successful capture. But without SOUNDCARD part I could not
hear incoming voice, though it is captured into .wav file.

So there seems to be a real bug in ALTER PORT command.



Hi all,

I want to know wich port i will use for transmitting skype's audio.

Thanks.
botastone
hi, we are doing the same thing in a university project, but because of the problems listed in the posts above we have not yet managed to transmit the skype audio to a port. any ideas?
Mirje
As it seems that there's a lot of questions about the PORT property then I really suggest that somebody makes Jira issue for it so that we could properly track it and find some answers from our developers. Otherwise it's a lot of talking here but no questions are really answered.

Everybody can also Vote for it then so that I would have more ground when going to the developers.

Regards,
Mirje
Avo Nappo
> there was no packages to the port 23456, no matter whether I compiled with included FILE


There is another thread here, more or less on the same subject. Just added example code of redirecting microphone to a port.

http://forum.skype.com/index.php?showtopic...mp;#entry403310
amjad
Hi i used socket to read data from the port and i get data on that port
but when i try to save that data i dont know how to save it .. do i need special buffer to read that data ... isaved it as text but when i try to play with vlc player it seem does not do any thing any body have any idea how to make it work
below is the code thanks

FileOutputStream out; // declare a file output object
PrintStream p; // declare a print stream object
public static void main(String args[]) {
// declaration section:
// declare a server socket and a client socket for the server
// declare an input and an output stream
ServerSocket echoServer = null;
String line;
byte[] buffer=new byte[512];
DataInputStream is;
PrintStream os;
Socket clientSocket = null;
// Try to open a server socket on port 9999
// Note that we can't choose a port less than 1023 if we are not
// privileged users (root)
try {
echoServer = new ServerSocket(9999);
}
catch (IOException e) {
System.out.println(e);
}
// Create a socket object from the ServerSocket to listen and accept
// connections.
// Open input and output streams

try {
clientSocket = echoServer.accept();
is = new DataInputStream(clientSocket.getInputStream());
os = new PrintStream(clientSocket.getOutputStream());


// As long as we receive data, echo that data back to the client.
echo3 e=new echo3();
e.Initit();

while (true)
{

int length=clientSocket.getReceiveBufferSize();
line = is.readLine();
byte b=is.readByte();
//is.read(line);
System.out.println(line);

e.WriteStreamToFile(line);
//os.println(line);
}


}
catch (IOException e) {
System.out.println(e);
}

}
public void echo3()
{

}
protected void finalize ()
{
p.close();
}
public void Initit()
{
try {
out = new FileOutputStream("C:\\myfile.wav");
p = new PrintStream(out);
} catch(Exception e) {
// TODO: handle exception
}

}
public void WriteStreamToFile(String line)
{

try
{
// Create a new file output stream
// connected to "myfile.txt"
p.print(line);
//p.println (line);

// Connect print stream to the output stream





}
catch (Exception e)
{
System.err.println ("Error writing to file");
}
}

}
Qambber
Yeah ... use the Java Sound Api. Make an

AudioFormat somthing like ...

AudioFormat audioFormat = new AudioFormat((float) 16000.0, 16, 1, true, false);


and then make an AudioInputStream. read the data as a DataInputStream and pass it to AudioInputStream.

when you are done with that ...

Make an AudioSystem and call its write method (you will need to pass audioFormat and AudioInputStream) to the method ... and just write it to the disk as a .wav file.

If you do this, it will work but I don't have a code sample for you. Hope this helps.

regards,
Qambber.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.