Help - Search - Members - Calendar
Full Version: Skype4java Voice and Video Stream
Skype Community > English > Development, Betas and Skype Garage > Skype Public API
amjad
Hi my question is how to set a event to receive voice or video stream from skype client into my application so i can do different operation on that stream once i received like transfer that stream to another computer using jmf rtp transmitter....
any body know any api or example for it thanks
Koji Hisano
Using the latest code of Skype4Java in the CVS, you are able to handle voice stream data.

Please, read the 'Voice Streams' secton of the Skype API specification and check these APIs.
Call#setPortInput(int)
Call#setPortOutout(int)
Call#setPortCaptureMic(int)

There is no video stream APIs in Skype API.
If you would like to handle video stream data, you have to capture a video call window continuously by PrintWindow Win32 API and use a virtual WebCam driver.
botastone
hi Amjad,
do Call#setPortInput(int), Call#setPortOutout(int) work for you? i tried, in api, and in skype4com also, but without succes. i would be really keen to know, if you have managed to do a working application with this command in Java. thx
amjad
Hi i am struggleing to implement skype with jmf.... actualy i want to stream voice data from one computer to another using jmf rtp stuffs.... i want to capture skype voice data and uinsg rtp streaming i want to stream it to another computer .......
any body know any example skype with jmf thanks
kuan
QUOTE(amjad @ Fri May 25 2007, 12:22) [snapback]399241[/snapback]

Hi i am struggleing to implement skype with jmf.... actualy i want to stream voice data from one computer to another using jmf rtp stuffs.... i want to capture skype voice data and uinsg rtp streaming i want to stream it to another computer .......
any body know any example skype with jmf thanks


You can forward the voice stream to a local port, and your application will be able to listen to it by creating a TCP socket.

https://developer.skype.com/Docs/ApiDoc/Voice_Streams

Is that what you want? I don't know about jmf but I guess once you get the voice data, you can do whatever you want to do.
MOSBAHAbdelkader
QUOTE(kuan @ Fri May 25 2007, 14:55) [snapback]399288[/snapback]

You can forward the voice stream to a local port, and your application will be able to listen to it by creating a TCP socket.

https://developer.skype.com/Docs/ApiDoc/Voice_Streams

Is that what you want? I don't know about jmf but I guess once you get the voice data, you can do whatever you want to do.


Hello Amjad,

To change voice stream properties of a CALL object, there are three extensions of the ALTER CALL command:

ALTER CALL <id> SET_INPUT SOUNDCARD="default" | PORT="port_no" | FILE="FILE_LOCATION"

This enables you to set a port or a wav file as a source of your voice, instead of a microphone.

ALTER CALL <id> SET_OUTPUT SOUNDCARD="default" | PORT="port_no" | FILE="FILE_LOCATION"

Redirects incoming transmission to a port or a wav file.

ALTER CALL <id> SET_CAPTURE_MIC SOUNDCARD="default" | PORT="port_no" | FILE="FILE_LOCATION"

Captures your own voice from microphone to a port or a wav file.

now with skype4java you need to do the following :

try {

Connector.getInstance().execute"HERE TYPE YOUR COMMAND LIKE : ALTER CALL <id> SET_OUTPUT SOUNDCARD="default" | PORT="port_no" | FILE="FILE_LOCATION"");
} catch (ConnectorException ex) {
ex.printStackTrace();
}


For the use of the PORT property i hav'nt tried it yet but for the SOUNDCARD and FILE properties it works very well.

Sincerly.
MOSBAHAbdelkader
Hello,

If someone has used the PORT property successfully please give us an example of code about how to manage the voice passed to the port.

thanks.
Vlad0
It seems nobody "has used the PORT property successfully": there is a bug
in Skype API. See the discussion in
http://forum.skype.com/index.php?showtopic=72601
MOSBAHAbdelkader
hello,

How to report this bug to the skype staff?

thanks.
MOSBAHAbdelkader
hello,

i think that the PORT property works because i have found this :

http://www.td.unige.ch/diplome_boller.htm
http://www.td.unige.ch/pdf/Boller.pdf

any reply??
Vlad0
QUOTE(MOSBAHAbdelkader @ Sat May 26 2007, 22:38) [snapback]399707[/snapback]

hello,

i think that the PORT property works because i have found this :

http://www.td.unige.ch/diplome_boller.htm
http://www.td.unige.ch/pdf/Boller.pdf

any reply??


Well, formally speaking, the bug in question appears if one uses
Skype4Com library as a wrapper around "bare" Skype API.
So in theory it may be the bug not in Sype API itself,
but in Skype4Com, and this bug is not present in
Java wrapper -- Skype4Java.
Though I doubt that this is the case. As far as I understand,
Skype4Com just sends text commands to Skype API,
without trying to interpret or change them.

By the way, it seems that You have tried yourself to use PORT command
with Skype4Java and Your attempt failed? smile.png If so, this confirms imho,
that the bug in question is in API itself, not in one of the wrappers around this API.

As to the links You gave: the presentation there is too schematic, with no concrete details.
Skype API's are mentioned in one place as being used, but again with no details,
so that one can not conclude from vague description given there, that
PORT command was used at all. Moreover, it seems as if there is described
only the project, which is not jet realized: no source, no jar's -- nothing real.
MOSBAHAbdelkader
QUOTE(Vlad0 @ Sun May 27 2007, 16:51) [snapback]399932[/snapback]

Well, formally speaking, the bug in question appears if one uses
Skype4Com library as a wrapper around "bare" Skype API.
So in theory it may be the bug not in Sype API itself,
but in Skype4Com, and this bug is not present in
Java wrapper -- Skype4Java.
Though I doubt that this is the case. As far as I understand,
Skype4Com just sends text commands to Skype API,
without trying to interpret or change them.

By the way, it seems that You have tried yourself to use PORT command
with Skype4Java and Your attempt failed? smile.png If so, this confirms imho,
that the bug in question is in API itself, not in one of the wrappers around this API.

As to the links You gave: the presentation there is too schematic, with no concrete details.
Skype API's are mentioned in one place as being used, but again with no details,
so that one can not conclude from vague description given there, that
PORT command was used at all. Moreover, it seems as if there is described
only the project, which is not jet realized: no source, no jar's -- nothing real.



Hello Vlad0,

Really i havn't tested the PORT property because i don't know how to test it and see the result to confirm that
PORT works.
For the SOUNDCARD and the FILE properties i can see the results because i see the output of my program but for the PORT it's not the case.


If someone has examples about it it will be very helpful.
Vlad0
If You have some firewall installed, which logs all the traffic packets,
You can just see the traffic log file immediately after Your program
(or, rather, Skype instructed by Your program) will send
the call stream say to PORT 12345 to see whether there are
some packeges to/from this port sent by Skype.
On my PC Sygate personal firewall is installed, and there were no
traffic from given port discovered.

This is the simplest way, no special net traffic analizer
programs are needed to localize the bug, if it is present.
MOSBAHAbdelkader
QUOTE(Vlad0 @ Sun May 27 2007, 19:12) [snapback]399960[/snapback]

If You have some firewall installed, which logs all the traffic packets,
You can just see the traffic log file immediately after Your program
(or, rather, Skype instructed by Your program) will send
the call stream say to PORT 12345 to see whether there are
some packeges to/from this port sent by Skype.
On my PC Sygate personal firewall is installed, and there were no
traffic from given port discovered.

This is the simplest way, no special net traffic analizer
programs are needed to localize the bug, if it is present.



I will test that but i think the port is a local port then the traffic will not be sent via the network.

It will be an other application that receives this traffic in the same computer.
amjad
HI any one tried the port property works... for me and also reading other forums it seem that it has bug some how ........

realy need to work port property so i can get the audio stream instead saving in the file and reading for the call is not a good option except auto ansing machine but to direct real time data into another mahcine we need to get the stream and send it to uisng rtp packets .....


please help us skypee thanks
MOSBAHAbdelkader
QUOTE(amjad @ Mon Jun 4 2007, 15:39) [snapback]402565[/snapback]

HI any one tried the port property works... for me and also reading other forums it seem that it has bug some how ........

realy need to work port property so i can get the audio stream instead saving in the file and reading for the call is not a good option except auto ansing machine but to direct real time data into another mahcine we need to get the stream and send it to uisng rtp packets .....
please help us skypee thanks



Hello,

I have reported that bug in JIRA : https://developer.skype.com/jira/browse/SDZ-87
but no answer yet.
amjad
we have another function called receivedCall.setPortOutput(3400); but i havnot test that yet have any body used that function instread Alter command

thanks
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");
}
}

}
pmathur
--Sorry, wrong thread.
Vlad0
This thread is corrupted!!! All posts in original thread after post #18
have disappeared!!!

To see correct working code of Java server, listening to Skype chats
see post #24 in the thread
http://forum.skype.com/index.php?showtopic=98952&st=20
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.