mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
removed test 000
This commit is contained in:
parent
c290660d51
commit
2f4a04a233
|
@ -22,10 +22,6 @@ set(FRAMESPERBURST 3)
|
||||||
set(BURSTS 1)
|
set(BURSTS 1)
|
||||||
set(TESTFRAMES 3)
|
set(TESTFRAMES 3)
|
||||||
|
|
||||||
add_test(NAME 000_audio_tests
|
|
||||||
COMMAND sh -c "cd ${CMAKE_CURRENT_SOURCE_DIR}/test/000_audio_tests;
|
|
||||||
python3 sinustest.py")
|
|
||||||
|
|
||||||
add_test(NAME 001_highsnr_stdio_P_C
|
add_test(NAME 001_highsnr_stdio_P_C
|
||||||
COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src;
|
COMMAND sh -c "export LD_LIBRARY_PATH=${CODEC2_BUILD_DIR}/src;
|
||||||
PATH=$PATH:${CODEC2_BUILD_DIR}/src;
|
PATH=$PATH:${CODEC2_BUILD_DIR}/src;
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
# FreeDV-JATE
|
|
||||||
## Just Another TNC Experiment
|
|
||||||
|
|
||||||
Audio tests!
|
|
||||||
|
|
||||||
## Frame rate conversion
|
|
||||||
### 48000Hz down to 8000Hz with different frame rate converters
|
|
||||||
|
|
||||||
#### Install
|
|
||||||
pip3 install miniaudio
|
|
||||||
|
|
||||||
|
|
||||||
#### Run
|
|
||||||
python3 sinustest.py
|
|
|
@ -1,50 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
import pyaudio
|
|
||||||
import numpy as np
|
|
||||||
import audioop
|
|
||||||
import miniaudio
|
|
||||||
|
|
||||||
volume = 0.5
|
|
||||||
fshigh = 48000
|
|
||||||
fslow = 8000
|
|
||||||
duration = 50.0
|
|
||||||
f = 440.0
|
|
||||||
|
|
||||||
samples_48000 = (np.sin(2*np.pi*np.arange(fshigh*duration)*f/fshigh)).astype(np.float32)
|
|
||||||
samples_8000 = (np.sin(2*np.pi*np.arange(fslow*duration)*f/fslow)).astype(np.float32)
|
|
||||||
samples_converted = audioop.ratecv(samples_48000,2,1,fshigh, fslow , None)
|
|
||||||
samples_converted = bytes(samples_converted[0])
|
|
||||||
|
|
||||||
converted_frames = miniaudio.convert_frames(miniaudio.SampleFormat.FLOAT32, 1, 48000, bytes(samples_48000), miniaudio.SampleFormat.FLOAT32, 1, 8000)
|
|
||||||
#converted_frames = bytes(converted_frames)
|
|
||||||
|
|
||||||
print(type(samples_8000))
|
|
||||||
print(type(samples_converted))
|
|
||||||
print(type(converted_frames))
|
|
||||||
|
|
||||||
# TODO - write ouputs to .int16 files so we can compare them
|
|
||||||
|
|
||||||
'''
|
|
||||||
p = pyaudio.PyAudio()
|
|
||||||
stream = p.open(format=pyaudio.paFloat32,
|
|
||||||
channels=2,
|
|
||||||
rate=fshigh,
|
|
||||||
output=True,
|
|
||||||
output_device_index=0 #static.AUDIO_OUTPUT_DEVICE
|
|
||||||
)
|
|
||||||
print("original 48000Hz sample")
|
|
||||||
stream.write(samples_48000)
|
|
||||||
print("original 8000Hz sample")
|
|
||||||
stream.write(samples_8000)
|
|
||||||
print("48000Hz to 8000Hz with audioop")
|
|
||||||
stream.write(samples_converted)
|
|
||||||
print("48000Hz to 8000Hz with miniaudio")
|
|
||||||
stream.write(converted_frames)
|
|
||||||
|
|
||||||
|
|
||||||
stream.stop_stream()
|
|
||||||
stream.close()
|
|
||||||
p.terminate()
|
|
||||||
'''
|
|
Loading…
Reference in a new issue