By looking into another SIPp related question I learned that it is now possible to play WAV files using the rtp_stream
action.
I've tried several different WAV files with no success. All I get is some noise instead of the expected sound.
In one comment in the mentioned question there is a simple instruction to convert a WAV file to a compatible format but it didn't work as well.
I've also tried to use sox to convert this file with no success.
Can anyone instruct me on how to generate a valid WAV file to be used with SIPp?
This is my recv 200 OK
command which includes the play audio action:
<recv response="200" rtd="true">
<action>
<exec rtp_stream="sorry_dave.wav,-1" />
</action>
</recv>
You can use Audacity to encode wav for sipp : Select in the bottom bar 8000Hz for the project and export the audio as 'Another compressed format' : click 'Options' and select 'WAV (Microsoft)' Header and 'A-Law' Encoding (for PCMA) or 'U-Law' (for PCMU).
You should also verify your scenario file : SDP message must have PCMA or PCMU audio and use "rtpstream_audio_port" like this (for PCMA) :
Sorry - It's a bit vague now as it's been so long since I did this. To my best recollection u-law encoding didn't work in sipp so I encoded the file as a-law using this script I built. I noted there were some nuances to the conversion using sox. In my opinion you either have a mismatched SDP, or are incorrectly encoding the file, make sure you only use one channel. Try the methods and code I posted below.
The file header should read
File Size: 54.7k Bit Rate: 64.1k Encoding: A-law
Channels: 1 @ 13-bit
Samplerate: 8000Hz
Replaygain: off
Duration: 00:00:06.83
or
File Size: 54.7k Bit Rate: 64.1k Encoding: u-law
Channels: 1 @ 14-bit
Samplerate: 8000Hz
Replaygain: off
Duration: 00:00:06.83
./wav_to_gsm.sh sorry_dave.wav sorry_dave_alaw.wav sox alaw
I was looking for different WAV file encodings and found a lot of them on Wikipedia.
I've found one file (
8,000 Hz µ-Law
) that works correctly with thertp_stream="8kulaw.wav,-1,0"
exec parameter.This is the file information:
I've tried to encode this file to the exact same configuration using this
Sox
command but it did NOT worked: