File tree Expand file tree Collapse file tree 4 files changed +14
-10
lines changed
sandbox/examples-sdr/generator-am_sender-audiokit Expand file tree Collapse file tree 4 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -40,12 +40,15 @@ void setup() {
40
40
audio_data.resize (num_samples);
41
41
modulated_data.resize (num_samples);
42
42
43
+ // define resample
44
+ auto rcfg = resample.defaultConfig ();
43
45
// define resample we resample the audio data from 44100 to 13M
44
- resample.begin (sample_rate, sample_rate_carrier);
46
+ rcfg.step_size = resample.getStepSize (sample_rate, sample_rate_carrier);
47
+ rcfg.channels = channels;
48
+ resample.begin (rcfg);
45
49
46
50
// setup test tone
47
51
auto cfgs = sound.defaultConfig ();
48
- cfgs.sample_rate = sample_rate;
49
52
cfgs.channels = channels;
50
53
sound.begin (cfgs);
51
54
Original file line number Diff line number Diff line change @@ -16,13 +16,13 @@ void setup(void) {
16
16
AudioLogger::instance ().begin (Serial, AudioLogger::Warning);
17
17
18
18
// define resample
19
- int sample_rate_from = sample_rate;
20
- int to_sample_rate = 22050 ;
21
- resample.begin (sample_rate_from, to_sample_rate);
19
+ auto rcfg = resample.defaultConfig ();
20
+ rcfg.step_size = 0.5
21
+ rcfg.channels = channels;
22
+ resample.begin (rcfg);
22
23
23
24
// Define CSV Output
24
25
auto config = out.defaultConfig ();
25
- config.sample_rate = sample_rate;
26
26
config.channels = channels;
27
27
out.begin (config);
28
28
Original file line number Diff line number Diff line change @@ -16,9 +16,10 @@ void setup(void) {
16
16
AudioLogger::instance ().begin (Serial, AudioLogger::Warning);
17
17
18
18
// define resample
19
- int sample_rate_from = sample_rate;
20
- int sample_rate_to = 22050 ;
21
- resample.begin (sample_rate_from, sample_rate_to);
19
+ auto rcfg = resample.defaultConfig ();
20
+ rcfg.step_size = 0.5
21
+ rcfg.channels = channels;
22
+ resample.begin (rcfg);
22
23
23
24
// Define CSV Output
24
25
auto config = out.defaultConfig ();
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ struct ResampleConfig : public AudioBaseInfo {
22
22
* @tparam T
23
23
*/
24
24
template <typename T>
25
- class ResampleStream : public AudioStream {
25
+ class ResampleStream : public AudioStreamX {
26
26
public:
27
27
// / Support for resampling via write.
28
28
ResampleStream (Print &out, int channelCount=2 ){
You can’t perform that action at this time.
0 commit comments