Changeset 2083
- Timestamp:
- Jun 27, 2008 10:47:33 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/test-pjsua/mod_media_playrec.py
r2078 r2083 31 31 32 32 # Test body function 33 def test_func(t , ud):33 def test_func(t): 34 34 global input_filename 35 35 global output_filename … … 38 38 39 39 # Get input file name 40 ud.input_filename = re.compile(const.MEDIA_PLAY_FILE).search(endpt.inst_param.arg).group(1)41 endpt.trace("Input file = " + ud.input_filename)40 input_filename = re.compile(const.MEDIA_PLAY_FILE).search(endpt.inst_param.arg).group(1) 41 endpt.trace("Input file = " + input_filename) 42 42 43 43 # Get output file name 44 ud.output_filename = re.compile(const.MEDIA_REC_FILE).search(endpt.inst_param.arg).group(1)45 endpt.trace("Output file = " + ud.output_filename)44 output_filename = re.compile(const.MEDIA_REC_FILE).search(endpt.inst_param.arg).group(1) 45 endpt.trace("Output file = " + output_filename) 46 46 47 47 # Find appropriate clock rate for the input file 48 clock_rate = re.compile(".+(\.\d+\.wav)$").match( ud.output_filename).group(1)48 clock_rate = re.compile(".+(\.\d+\.wav)$").match(output_filename).group(1) 49 49 if (clock_rate==None): 50 50 endpt.trace("Cannot compare input & output, incorrect output filename format") 51 51 return 52 ud.input_filename = re.sub("\.\d+\.wav$", clock_rate, ud.input_filename)53 endpt.trace("WAV file to be compared with output = " + ud.input_filename)52 input_filename = re.sub("\.\d+\.wav$", clock_rate, input_filename) 53 endpt.trace("WAV file to be compared with output = " + input_filename) 54 54 55 55 # Connect input-output file … … 70 70 71 71 # Post body function 72 def post_func(t , ud):72 def post_func(t): 73 73 global input_filename 74 74 global output_filename … … 77 77 78 78 # Check WAV similarity 79 fullcmd = COMPARE_WAV_EXE + " " + ud.input_filename + " " + ud.output_filename + " " + "3000"79 fullcmd = COMPARE_WAV_EXE + " " + input_filename + " " + output_filename + " " + "3000" 80 80 endpt.trace("Popen " + fullcmd) 81 81 cmp_proc = subprocess.Popen(fullcmd, stdout=subprocess.PIPE, universal_newlines=True)
Note: See TracChangeset
for help on using the changeset viewer.