Skip to content

Commit

Permalink
added a default starting fs for many of the examples, which may help …
Browse files Browse the repository at this point in the history
…with compatibility with other hosts)
  • Loading branch information
leomccormack committed Jan 24, 2024
1 parent ada5293 commit e116a40
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/src/ambi_dec/ambi_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ void ambi_dec_create
pData->transitionFreq = 800.0f;

/* afSTFT stuff and audio buffers */
pData->hSTFT = NULL;
pData->fs = 48000.0f;
pData->hSTFT = NULL;
pData->SHFrameTD = (float**)malloc2d(MAX_NUM_SH_SIGNALS, AMBI_DEC_FRAME_SIZE, sizeof(float));
pData->outputFrameTD = (float**)malloc2d(SAF_MAX(MAX_NUM_LOUDSPEAKERS, NUM_EARS), AMBI_DEC_FRAME_SIZE, sizeof(float));
pData->SHframeTF = (float_complex***)malloc3d(HYBRID_BANDS, MAX_NUM_SH_SIGNALS, TIME_SLOTS, sizeof(float_complex));
Expand Down
1 change: 1 addition & 0 deletions examples/src/ambi_enc/ambi_enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ void ambi_enc_create
int i;

pData->order = 1;
pData->fs = 48000.0f;

/* default user parameters */
loadSourceConfigPreset(SOURCE_CONFIG_PRESET_DEFAULT, pData->src_dirs_deg, &(pData->new_nSources));
Expand Down
1 change: 1 addition & 0 deletions examples/src/ambi_roomsim/ambi_roomsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ void ambi_roomsim_create
memset(pData->rec_pos, 0, ROOM_SIM_MAX_NUM_RECEIVERS*3*sizeof(float));

/* Internal */
pData->fs = 48000.0f;
pData->hIms = NULL;
float src_pos[3] = {5.2f, 1.5f, 1.4f};
memcpy(pData->src_pos[0], src_pos, 3*sizeof(float));
Expand Down
1 change: 1 addition & 0 deletions examples/src/array2sh/array2sh.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ void array2sh_create
pData->enableDiffEQpastAliasing = 1;

/* time-frequency transform + buffers */
pData->fs = 48000.0f;
pData->hSTFT = NULL;
pData->inputFrameTD = (float**)malloc2d(MAX_NUM_SENSORS, ARRAY2SH_FRAME_SIZE, sizeof(float));
pData->SHframeTD = (float**)malloc2d(MAX_NUM_SH_SIGNALS, ARRAY2SH_FRAME_SIZE, sizeof(float));
Expand Down
1 change: 1 addition & 0 deletions examples/src/binauraliser/binauraliser.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ void binauraliser_create

/* time-frequency transform + buffers */
pData->hSTFT = NULL;
pData->fs = 48000.0f;
pData->inputFrameTD = (float**)malloc2d(MAX_NUM_INPUTS, BINAURALISER_FRAME_SIZE, sizeof(float));
pData->outframeTD = (float**)malloc2d(NUM_EARS, BINAURALISER_FRAME_SIZE, sizeof(float));
pData->inputframeTF = (float_complex***)malloc3d(HYBRID_BANDS, MAX_NUM_INPUTS, TIME_SLOTS, sizeof(float_complex));
Expand Down
1 change: 1 addition & 0 deletions examples/src/binauraliser_nf/binauraliser_nf.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ void binauraliserNF_create /* FREQUENCY DOMAIN version */
pData->hrir_loaded_fs = pData->hrir_runtime_fs = -1; /* unknown */

/* time domain buffers */
pData->fs = 48000.0f;
pData->inputFrameTD = (float**)malloc2d(MAX_NUM_INPUTS, BINAURALISER_FRAME_SIZE, sizeof(float));
pData->outframeTD = (float**)malloc2d(NUM_EARS, BINAURALISER_FRAME_SIZE, sizeof(float));
pData->inputframeTF = (float_complex***)malloc3d(HYBRID_BANDS, MAX_NUM_INPUTS, TIME_SLOTS, sizeof(float_complex));
Expand Down
1 change: 1 addition & 0 deletions examples/src/decorrelator/decorrelator.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ void decorrelator_create
pData->compensateLevel = 0;

/* afSTFT stuff */
pData->fs = 48000.0f;
pData->hSTFT = NULL;
pData->InputFrameTD = (float**)malloc2d(MAX_NUM_CHANNELS, DECORRELATOR_FRAME_SIZE, sizeof(float));
pData->OutputFrameTD = (float**)malloc2d(MAX_NUM_CHANNELS, DECORRELATOR_FRAME_SIZE, sizeof(float));
Expand Down
1 change: 1 addition & 0 deletions examples/src/dirass/dirass.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ void dirass_create
pData->recalcPmap = 1;

/* set FIFO buffers */
pData->fs = 48000.0f;
pData->FIFO_idx = 0;
memset(pData->inFIFO, 0, MAX_NUM_INPUT_SH_SIGNALS*DIRASS_FRAME_SIZE*sizeof(float));
}
Expand Down
1 change: 1 addition & 0 deletions examples/src/matrixconv/matrixconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ void matrixconv_create
pData->nOutputChannels = 0;

/* set FIFO buffers */
pData->host_fs = 48000.0f;
pData->FIFO_idx = 0;
memset(pData->inFIFO, 0, MAX_NUM_CHANNELS*MAX_FRAME_SIZE*sizeof(float));
memset(pData->outFIFO, 0, MAX_NUM_CHANNELS*MAX_FRAME_SIZE*sizeof(float));
Expand Down
1 change: 1 addition & 0 deletions examples/src/multiconv/multiconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ void multiconv_create
pData->filter_fs = 0;

/* set FIFO buffers */
pData->host_fs = 48000.0f;
pData->FIFO_idx = 0;
memset(pData->inFIFO, 0, MAX_NUM_CHANNELS*MAX_FRAME_SIZE*sizeof(float));
memset(pData->outFIFO, 0, MAX_NUM_CHANNELS*MAX_FRAME_SIZE*sizeof(float));
Expand Down
1 change: 1 addition & 0 deletions examples/src/panner/panner.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ void panner_create
pData->bFlipRoll = 0;

/* time-frequency transform + buffers */
pData->fs = 48000.0f;
pData->hSTFT = NULL;
pData->inputFrameTD = (float**)malloc2d(MAX_NUM_INPUTS, PANNER_FRAME_SIZE, sizeof(float));
pData->outputFrameTD = (float**)malloc2d(MAX_NUM_OUTPUTS, PANNER_FRAME_SIZE, sizeof(float));
Expand Down
1 change: 1 addition & 0 deletions examples/src/pitch_shifter/pitch_shifter.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ void pitch_shifter_create
pData->codecStatus = CODEC_STATUS_NOT_INITIALISED;

/* set FIFO buffers */
pData->sampleRate = 48000.0f;
pData->FIFO_idx = 0;
memset(pData->inFIFO, 0, MAX_NUM_CHANNELS*PITCH_SHIFTER_FRAME_SIZE*sizeof(float));
memset(pData->outFIFO, 0, MAX_NUM_CHANNELS*PITCH_SHIFTER_FRAME_SIZE*sizeof(float));
Expand Down
1 change: 1 addition & 0 deletions examples/src/powermap/powermap.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ void powermap_create
pData->recalcPmap = 1;

/* set FIFO buffer */
pData->fs = 48000.0f;
pData->FIFO_idx = 0;
memset(pData->inFIFO, 0, MAX_NUM_SH_SIGNALS*POWERMAP_FRAME_SIZE*sizeof(float));
}
Expand Down
1 change: 1 addition & 0 deletions examples/src/rotator/rotator.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ void rotator_create
*phRot = (void*)pData;

pData->M_rot_status = M_ROT_RECOMPUTE_QUATERNION;
pData->fs = 48000.0f;

/* Default user parameters */
pData->Q.w = 1.0f;
Expand Down
1 change: 1 addition & 0 deletions examples/src/sldoa/sldoa.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ void sldoa_create
}

/* set FIFO buffer */
pData->fs = 48000.0f;
pData->FIFO_idx = 0;
memset(pData->inFIFO, 0, MAX_NUM_SH_SIGNALS*SLDOA_FRAME_SIZE*sizeof(float));
}
Expand Down
1 change: 1 addition & 0 deletions examples/src/spreader/spreader.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void spreader_create
memset(pData->src_dirs_deg, 0, SPREADER_MAX_NUM_SOURCES*2*sizeof(float));

/* time-frequency transform + buffers */
pData->fs = 48000.0f;
pData->hSTFT = NULL;
pData->inputFrameTD = (float**)malloc2d(MAX_NUM_INPUTS, SPREADER_FRAME_SIZE, sizeof(float));
pData->outframeTD = (float**)malloc2d(MAX_NUM_OUTPUTS, SPREADER_FRAME_SIZE, sizeof(float));
Expand Down
1 change: 1 addition & 0 deletions examples/src/tvconv/tvconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void tvconv_create
pData->sofa_file_error = SAF_TVCONV_NOT_INIT;

/* set FIFO buffers */
pData->host_fs = 48000.0f;
pData->FIFO_idx = 0;
memset(pData->inFIFO, 0, MAX_NUM_CHANNELS*MAX_FRAME_SIZE*sizeof(float));
memset(pData->outFIFO, 0, MAX_NUM_CHANNELS*MAX_FRAME_SIZE*sizeof(float));
Expand Down

0 comments on commit e116a40

Please sign in to comment.