diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2008-06-20 17:43:55 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2008-06-20 17:43:55 +0000 |
commit | f06496992c8bbc62f899e4ee782889a3a4b08a4e (patch) | |
tree | bbb8901c176d4dbc7857e1cb8372206b76670ec2 /pjsip-apps/src/test-pjsua/mod_media_playrec.py | |
parent | 115f675e4a36b2b841c99e645ab6c89712e929ed (diff) |
More ticket #543: added SRTP tests on scripts-sendto
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2036 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src/test-pjsua/mod_media_playrec.py')
-rw-r--r-- | pjsip-apps/src/test-pjsua/mod_media_playrec.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/pjsip-apps/src/test-pjsua/mod_media_playrec.py b/pjsip-apps/src/test-pjsua/mod_media_playrec.py index 8d8a60fe..30f2f6db 100644 --- a/pjsip-apps/src/test-pjsua/mod_media_playrec.py +++ b/pjsip-apps/src/test-pjsua/mod_media_playrec.py @@ -1,11 +1,12 @@ # $Id$ # PLAYFILE -> RECFILE: -# input file is played and is recorded to output, then compare them. +# Input file is played and is recorded to output, then compare them. +# Useful to tes clock rates compatibility and resample quality # null-audio # port 1: wav file input xxxxxx.clock_rate.wav, e.g: test1.8.wav # port 2: wav file ouput xxxxxx.clock_rate.wav, e.g: res1.8.wav -# wav input more than 3 seconds +# wav input must be more than 3 seconds long import time import imp @@ -75,8 +76,20 @@ def post_func(t, ud): fullcmd = COMPARE_WAV_EXE + " " + ud.input_filename + " " + ud.output_filename + " " + "3000" endpt.trace("Popen " + fullcmd) cmp_proc = subprocess.Popen(fullcmd, stdout=subprocess.PIPE, universal_newlines=True) + + # Parse similarity ouput line = cmp_proc.stdout.readline() - endpt.trace("WAV similarity = " + line) + mo_sim_val = re.match(".+=\s+(\d+)", line) + if (mo_sim_val == None): + raise TestError("Error comparing WAV files") + return + + # Evaluate the similarity value + sim_val = mo_sim_val.group(1) + if (sim_val > 0): + endpt.trace("WAV similarity = " + sim_val) + else: + raise TestError("Degraded WAV heavily distorted") # Here where it all comes together |