kopia lustrzana https://github.com/sh123/codec2_talkie
Tuning modulator
rodzic
dd9ec9a08f
commit
f6ccd3d0fb
|
@ -28,7 +28,7 @@ public class SoundModem implements Transport, Runnable {
|
||||||
private static final String TAG = SoundModem.class.getSimpleName();
|
private static final String TAG = SoundModem.class.getSimpleName();
|
||||||
|
|
||||||
// NOTE, codec2 library requires that sample_rate % bit_rate == 0
|
// NOTE, codec2 library requires that sample_rate % bit_rate == 0
|
||||||
public static final int SAMPLE_RATE = 24000;
|
public static final int SAMPLE_RATE = 19200;
|
||||||
|
|
||||||
private final String _name;
|
private final String _name;
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ public class SoundModem implements Transport, Runnable {
|
||||||
if (_isLoopback) {
|
if (_isLoopback) {
|
||||||
synchronized (_sampleBuffer) {
|
synchronized (_sampleBuffer) {
|
||||||
if (_sampleBuffer.position() / 2 >= nin) {
|
if (_sampleBuffer.position() / 2 >= nin) {
|
||||||
Log.i(TAG, "nin: " + nin + ", pos: " + _sampleBuffer.position() / 2);
|
//Log.i(TAG, "nin: " + nin + ", pos: " + _sampleBuffer.position() / 2);
|
||||||
_sampleBuffer.flip();
|
_sampleBuffer.flip();
|
||||||
for (int i = 0; i < nin; i++) {
|
for (int i = 0; i < nin; i++) {
|
||||||
_recordAudioBuffer[i] = _sampleBuffer.getShort();
|
_recordAudioBuffer[i] = _sampleBuffer.getShort();
|
||||||
|
|
|
@ -60,7 +60,7 @@ namespace Java_com_ustadmobile_codec2_Codec2 {
|
||||||
struct ContextFsk *conFsk;
|
struct ContextFsk *conFsk;
|
||||||
conFsk = (struct ContextFsk *) malloc(sizeof(struct ContextFsk));
|
conFsk = (struct ContextFsk *) malloc(sizeof(struct ContextFsk));
|
||||||
struct FSK *fsk;
|
struct FSK *fsk;
|
||||||
fsk = fsk_create_hbr(sampleFrequency, symbolRate, MODE_2FSK, 10, FSK_DEFAULT_NSYM, toneFreq, toneSpacing);
|
fsk = fsk_create_hbr(sampleFrequency, symbolRate, MODE_2FSK, 8, FSK_DEFAULT_NSYM, toneFreq, toneSpacing);
|
||||||
conFsk->fsk = fsk;
|
conFsk->fsk = fsk;
|
||||||
|
|
||||||
conFsk->Nbits = fsk->Nbits;
|
conFsk->Nbits = fsk->Nbits;
|
||||||
|
|
Ładowanie…
Reference in New Issue