Softphone, webphone and VoIP server Forum

HomeHomeDiscussionsDiscussionsMizu WebphoneMizu WebphoneHow to convert UDP packets to  a file like wav How to convert UDP packets to  a file like wav
Previous
 
Next
New Post
3/14/2020 4:26 AM
 

How to convert UDP packets to  a file like wav 

I set webphoneobj。

webphoneobj.API_SetParameter("sendmedia_type","0");

webphoneobj.API_SetParameter("sendmediain_to","6666");

I can only play sound use this.

//import required libraries
import java.io.*;
import javax.sound.sampled.*;
//initialize audio
AudioFormat format = new AudioFormat(8000, 16, 1, true, false); //you need to use 8000 for narrowband input or 16000 for wide-band
DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
SourceDataLine line = (SourceDataLine)AudioSystem.getLine(info);
line.open(format);
line.start();
//playback (you can pass the UDP packets as-is as received from JVoIP)
//this is usually called many times from your UDP socket thread or on UDP packet received event
line.write(buffer, 0, length);
//close
line.flush();
line.stop();
line.close();

How to save as   UDP packets a file

 

 
New Post
6/10/2020 11:30 AM
 
It looks like we missed your post.
If the problem still persists, please write to webphone@mizu-voip.com
 
New Post
2/6/2021 8:30 PM
 
Hello. I created a free sip using Linphone but it. And it's. Giving me this error : register rejected bad request. Can anyone help me with this. I'm. Using a Huawei nova 5g phone.. Is this even compatible
 
New Post
8/23/2021 12:54 PM
 
Hello,

Did you succeed in creating a file or anything from the udp packets?
 
New Post
12/7/2021 6:20 PM
 

You just need to add a valid wave header. There are open source java libraries which can do this or contact our support for help.

 
Previous
 
Next
HomeHomeDiscussionsDiscussionsMizu WebphoneMizu WebphoneHow to convert UDP packets to  a file like wav How to convert UDP packets to  a file like wav


You need to register / login to be able to post in the forum