adjusted ctests to new codec2 module structure

This commit is contained in:
DJ2LS 2023-04-21 14:26:07 +02:00
parent df78e11bc3
commit 05290ae5ba
3 changed files with 9 additions and 9 deletions

View file

@ -113,7 +113,7 @@ class Test:
# open codec2 instance # open codec2 instance
self.datac0_freedv = ctypes.cast( self.datac0_freedv = ctypes.cast(
codec2.api.freedv_open(codec2.api.FREEDV_MODE_DATAC0), ctypes.c_void_p codec2.api.freedv_open(codec2.FREEDV_MODE.datac0.value), ctypes.c_void_p
) )
self.datac0_bytes_per_frame = int( self.datac0_bytes_per_frame = int(
codec2.api.freedv_get_bits_per_modem_frame(self.datac0_freedv) / 8 codec2.api.freedv_get_bits_per_modem_frame(self.datac0_freedv) / 8
@ -125,7 +125,7 @@ class Test:
self.datac0_buffer = codec2.audio_buffer(2 * self.AUDIO_FRAMES_PER_BUFFER) self.datac0_buffer = codec2.audio_buffer(2 * self.AUDIO_FRAMES_PER_BUFFER)
self.datac1_freedv = ctypes.cast( self.datac1_freedv = ctypes.cast(
codec2.api.freedv_open(codec2.api.FREEDV_MODE_DATAC1), ctypes.c_void_p codec2.api.freedv_open(codec2.FREEDV_MODE.datac1.value), ctypes.c_void_p
) )
self.datac1_bytes_per_frame = int( self.datac1_bytes_per_frame = int(
codec2.api.freedv_get_bits_per_modem_frame(self.datac1_freedv) / 8 codec2.api.freedv_get_bits_per_modem_frame(self.datac1_freedv) / 8
@ -137,7 +137,7 @@ class Test:
self.datac1_buffer = codec2.audio_buffer(2 * self.AUDIO_FRAMES_PER_BUFFER) self.datac1_buffer = codec2.audio_buffer(2 * self.AUDIO_FRAMES_PER_BUFFER)
self.datac3_freedv = ctypes.cast( self.datac3_freedv = ctypes.cast(
codec2.api.freedv_open(codec2.api.FREEDV_MODE_DATAC3), ctypes.c_void_p codec2.api.freedv_open(codec2.FREEDV_MODE.datac3.value), ctypes.c_void_p
) )
self.datac3_bytes_per_frame = int( self.datac3_bytes_per_frame = int(
codec2.api.freedv_get_bits_per_modem_frame(self.datac3_freedv) / 8 codec2.api.freedv_get_bits_per_modem_frame(self.datac3_freedv) / 8

View file

@ -111,7 +111,7 @@ class Test:
# open codec2 instance # open codec2 instance
self.datac0_freedv = ctypes.cast( self.datac0_freedv = ctypes.cast(
codec2.api.freedv_open(codec2.api.FREEDV_MODE_DATAC0), ctypes.c_void_p codec2.api.freedv_open(codec2.FREEDV_MODE.datac0.value), ctypes.c_void_p
) )
self.datac0_bytes_per_frame = int( self.datac0_bytes_per_frame = int(
codec2.api.freedv_get_bits_per_modem_frame(self.datac0_freedv) / 8 codec2.api.freedv_get_bits_per_modem_frame(self.datac0_freedv) / 8
@ -123,7 +123,7 @@ class Test:
self.datac0_buffer = codec2.audio_buffer(2 * self.AUDIO_FRAMES_PER_BUFFER) self.datac0_buffer = codec2.audio_buffer(2 * self.AUDIO_FRAMES_PER_BUFFER)
self.datac1_freedv = ctypes.cast( self.datac1_freedv = ctypes.cast(
codec2.api.freedv_open(codec2.api.FREEDV_MODE_DATAC1), ctypes.c_void_p codec2.api.freedv_open(codec2.FREEDV_MODE.datac1.value), ctypes.c_void_p
) )
self.datac1_bytes_per_frame = int( self.datac1_bytes_per_frame = int(
codec2.api.freedv_get_bits_per_modem_frame(self.datac1_freedv) / 8 codec2.api.freedv_get_bits_per_modem_frame(self.datac1_freedv) / 8
@ -135,7 +135,7 @@ class Test:
self.datac1_buffer = codec2.audio_buffer(2 * self.AUDIO_FRAMES_PER_BUFFER) self.datac1_buffer = codec2.audio_buffer(2 * self.AUDIO_FRAMES_PER_BUFFER)
self.datac3_freedv = ctypes.cast( self.datac3_freedv = ctypes.cast(
codec2.api.freedv_open(codec2.api.FREEDV_MODE_DATAC3), ctypes.c_void_p codec2.api.freedv_open(codec2.FREEDV_MODE.datac3.value), ctypes.c_void_p
) )
self.datac3_bytes_per_frame = int( self.datac3_bytes_per_frame = int(
codec2.api.freedv_get_bits_per_modem_frame(self.datac3_freedv) / 8 codec2.api.freedv_get_bits_per_modem_frame(self.datac3_freedv) / 8

View file

@ -158,9 +158,9 @@ class Test:
def create_modulation(self): def create_modulation(self):
modes = [ modes = [
codec2.api.FREEDV_MODE_DATAC0, codec2.FREEDV_MODE.datac0.value,
codec2.api.FREEDV_MODE_DATAC1, codec2.FREEDV_MODE.datac1.value,
codec2.api.FREEDV_MODE_DATAC3, codec2.FREEDV_MODE.datac3.value,
] ]
for m in modes: for m in modes: