Hi,
I got no replay for that. I have even put that question in rtpproxy form but no response.
I have appended the header (PCMA or PCMU) to that file using a java program and tried to play that file . It is playing but the audio quality is very bad.
Java code that I wrote to apped header
-------------------------------------------------------------------------
import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.AudioFileFormat.Type;
/** * * @author chaitanya */ public class AudioFileWriter { public static void main(String args[]) {
File file1 = new File("/home/chaitanya/Desktop/a.rtp"); //RTP file recorded by rtp proxy File file = new File("/home/chaitanya/Desktop/a.wav");//Out put wave file AudioFormat af=new AudioFormat(new AudioFormat.Encoding("ULAW"),8000,8,1,4,8000,false); // ULAW or ALAW what ever u r using and there respective bit rates
int length; try{ AudioInputStream ais=new AudioInputStream(new FileInputStream(file1),af,AudioSystem.NOT_SPECIFIED);
//ByteArrayInputStream bais=new ByteArrayInputStream(b,0,b.length); Type afft=new Type("WAVE","WAV");
AudioSystem.write(ais,afft,file); } catch(Exception e){ e.printStackTrace(); }
}
} ---------------------------------------------------------------------------------------------------
You can try this.
If you find any other solution please let me know.
regards, Chaitu
o Chaitanya V.N.S [06/24/08 16:29]:
Hi,
I got no replay for that. I have even put that question in rtpproxy
form but no response.
I have appended the header (PCMA or PCMU) to that file using a java program and tried to play that file . It is playing but the audio quality is very bad.
[...]
If you find any other solution please let me know.
if the .rtp file is the raw payload you can convert it using sox sox -t raw -1 -U a.rtp -t wav -s a.wav but you might strip the RTP headers (usually first 12 bytes) from every packet first (don't know whether rtpproxy does that).
hth Stefan