Ignore:
Timestamp:
Jun 20, 2008 5:43:55 PM (16 years ago)
Author:
nanang
Message:

More ticket #543: added SRTP tests on scripts-sendto

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/test-pjsua/mod_media_playrec.py

    r2029 r2036  
    22 
    33# PLAYFILE -> RECFILE: 
    4 # input file is played and is recorded to output, then compare them. 
     4# Input file is played and is recorded to output, then compare them. 
     5# Useful to tes clock rates compatibility and resample quality 
    56#       null-audio 
    67#       port 1: wav file input xxxxxx.clock_rate.wav, e.g: test1.8.wav 
    78#       port 2: wav file ouput xxxxxx.clock_rate.wav, e.g: res1.8.wav 
    8 #       wav input more than 3 seconds 
     9#       wav input must be more than 3 seconds long 
    910 
    1011import time 
     
    7677        endpt.trace("Popen " + fullcmd) 
    7778        cmp_proc = subprocess.Popen(fullcmd, stdout=subprocess.PIPE, universal_newlines=True) 
     79 
     80        # Parse similarity ouput 
    7881        line = cmp_proc.stdout.readline() 
    79         endpt.trace("WAV similarity = " + line) 
     82        mo_sim_val = re.match(".+=\s+(\d+)", line) 
     83        if (mo_sim_val == None): 
     84                raise TestError("Error comparing WAV files") 
     85                return 
     86 
     87        # Evaluate the similarity value 
     88        sim_val = mo_sim_val.group(1) 
     89        if (sim_val > 0): 
     90                endpt.trace("WAV similarity = " + sim_val) 
     91        else: 
     92                raise TestError("Degraded WAV heavily distorted") 
    8093 
    8194 
Note: See TracChangeset for help on using the changeset viewer.