- Timestamp:
- Jun 20, 2008 5:43:55 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/test-pjsua/mod_media_playrec.py
r2029 r2036 2 2 3 3 # 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 5 6 # null-audio 6 7 # port 1: wav file input xxxxxx.clock_rate.wav, e.g: test1.8.wav 7 8 # port 2: wav file ouput xxxxxx.clock_rate.wav, e.g: res1.8.wav 8 # wav input m ore than 3 seconds9 # wav input must be more than 3 seconds long 9 10 10 11 import time … … 76 77 endpt.trace("Popen " + fullcmd) 77 78 cmp_proc = subprocess.Popen(fullcmd, stdout=subprocess.PIPE, universal_newlines=True) 79 80 # Parse similarity ouput 78 81 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") 80 93 81 94
Note: See TracChangeset
for help on using the changeset viewer.