Loading tests/rtp/test_format_switching.py +19 −14 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ To configure test modules. import os import sys import pytest from tempfile import TemporaryDirectory from pathlib import Path Loading Loading @@ -90,9 +91,10 @@ FORMAT_ARGUMENT_MAPPING = { "ISM4SBA3": ["-ism_sba", "4", "+3"], } @pytest.mark.skip(reason="Needs to be replaced with new test using the normal encoder") def test_format_switching_new_encoder( record_property, dut_decoder_frontend: DecoderFrontend record_property, dut_decoder_frontend: DecoderFrontend ): bitrate = 48000 fs = 48 Loading @@ -106,9 +108,10 @@ def test_format_switching_new_encoder ( ) with TemporaryDirectory() as tmp_dir: # Create file for encoding commands temp_format_switching_file = Path(tmp_dir).joinpath("format_switching_input.txt").absolute() temp_format_switching_file = ( Path(tmp_dir).joinpath("format_switching_input.txt").absolute() ) temp_rtpdump = Path(tmp_dir).joinpath("output_concatenated.rtpdump").absolute() with open(temp_format_switching_file, mode="a") as outFile: for key, audioFile in FORMAT_TO_FILE_COMPARETEST.items(): Loading @@ -130,26 +133,28 @@ def test_format_switching_new_encoder ( encoder_args += [str(cutFile)] encoder_args += [str(temp_rtpdump)] outFile.write(' '.join(encoder_args)) outFile.write(" ".join(encoder_args)) outFile.write("\n") # Encode with the format switch encoder dut_encoder_fmtsw_frontend.run( bitrate='', input_sampling_rate='', bitrate="", input_sampling_rate="", input_path=temp_format_switching_file, output_bitstream_path='', output_bitstream_path="", quiet_mode=False, fmtsw_command=True fmtsw_command=True, ) # Decode the combined bitstreams cat_output_rtpdump = Path(tmp_dir).joinpath(f"output_concatenated.wav").absolute() cat_output_rtpdump = ( Path(tmp_dir).joinpath(f"output_concatenated.wav").absolute() ) dut_decoder_frontend.run( output_config=outMode, output_sampling_rate=48, input_bitstream_path=temp_rtpdump, output_path=cat_output_rtpdump, add_option_list= ["-VOIP_HF_ONLY=1"] add_option_list=["-VOIP_HF_ONLY=1"], ) Loading
tests/rtp/test_format_switching.py +19 −14 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ To configure test modules. import os import sys import pytest from tempfile import TemporaryDirectory from pathlib import Path Loading Loading @@ -90,9 +91,10 @@ FORMAT_ARGUMENT_MAPPING = { "ISM4SBA3": ["-ism_sba", "4", "+3"], } @pytest.mark.skip(reason="Needs to be replaced with new test using the normal encoder") def test_format_switching_new_encoder( record_property, dut_decoder_frontend: DecoderFrontend record_property, dut_decoder_frontend: DecoderFrontend ): bitrate = 48000 fs = 48 Loading @@ -106,9 +108,10 @@ def test_format_switching_new_encoder ( ) with TemporaryDirectory() as tmp_dir: # Create file for encoding commands temp_format_switching_file = Path(tmp_dir).joinpath("format_switching_input.txt").absolute() temp_format_switching_file = ( Path(tmp_dir).joinpath("format_switching_input.txt").absolute() ) temp_rtpdump = Path(tmp_dir).joinpath("output_concatenated.rtpdump").absolute() with open(temp_format_switching_file, mode="a") as outFile: for key, audioFile in FORMAT_TO_FILE_COMPARETEST.items(): Loading @@ -130,26 +133,28 @@ def test_format_switching_new_encoder ( encoder_args += [str(cutFile)] encoder_args += [str(temp_rtpdump)] outFile.write(' '.join(encoder_args)) outFile.write(" ".join(encoder_args)) outFile.write("\n") # Encode with the format switch encoder dut_encoder_fmtsw_frontend.run( bitrate='', input_sampling_rate='', bitrate="", input_sampling_rate="", input_path=temp_format_switching_file, output_bitstream_path='', output_bitstream_path="", quiet_mode=False, fmtsw_command=True fmtsw_command=True, ) # Decode the combined bitstreams cat_output_rtpdump = Path(tmp_dir).joinpath(f"output_concatenated.wav").absolute() cat_output_rtpdump = ( Path(tmp_dir).joinpath(f"output_concatenated.wav").absolute() ) dut_decoder_frontend.run( output_config=outMode, output_sampling_rate=48, input_bitstream_path=temp_rtpdump, output_path=cat_output_rtpdump, add_option_list= ["-VOIP_HF_ONLY=1"] add_option_list=["-VOIP_HF_ONLY=1"], )