Skip to content

Commit 7aafe4f

Browse files
committed
cleanup AnalogAudioStream
1 parent b6a6cd5 commit 7aafe4f

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/AudioAnalog/AnalogAudio.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ class AnalogAudioStream : public AudioStream {
6464
driver.end();
6565
}
6666

67-
/// Overides the sample rate and uses the max value which is around ~13MHz. Call this methd after begin();
68-
void setMaxSampleRate() {
69-
driver.setMaxSampleRate();
70-
}
67+
// /// Overides the sample rate and uses the max value which is around ~13MHz. Call this methd after begin();
68+
// void setMaxSampleRate() {
69+
// driver.setMaxSampleRate();
70+
// }
7171

7272
AnalogConfig &config() {
7373
return adc_config;

src/AudioAnalog/AnalogAudioBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class AnalogDriverBase {
154154
public:
155155
virtual bool begin(AnalogConfig cfg);
156156
virtual void end();
157-
virtual void setMaxSampleRate() {}
157+
// virtual void setMaxSampleRate() {}
158158
virtual size_t write(const uint8_t *src, size_t size_bytes) { return 0;}
159159
virtual size_t readBytes(uint8_t *dest, size_t size_bytes);
160160
virtual int available();

src/AudioAnalog/AnalogAudioESP32.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ class AnalogDriverESP32 : public AnalogDriverBase {
145145
active = false;
146146
}
147147

148-
/// Overides the sample rate and uses the max value which is around ~13MHz. Call this methd after begin();
149-
void setMaxSampleRate() {
150-
//this is the hack that enables the highest sampling rate possible ~13MHz, have fun
151-
SET_PERI_REG_BITS(I2S_CLKM_CONF_REG(0), I2S_CLKM_DIV_A_V, 1, I2S_CLKM_DIV_A_S);
152-
SET_PERI_REG_BITS(I2S_CLKM_CONF_REG(0), I2S_CLKM_DIV_B_V, 1, I2S_CLKM_DIV_B_S);
153-
SET_PERI_REG_BITS(I2S_CLKM_CONF_REG(0), I2S_CLKM_DIV_NUM_V, 1, I2S_CLKM_DIV_NUM_S);
154-
SET_PERI_REG_BITS(I2S_SAMPLE_RATE_CONF_REG(0), I2S_TX_BCK_DIV_NUM_V, 1, I2S_TX_BCK_DIV_NUM_S);
155-
}
148+
// /// Overides the sample rate and uses the max value which is around ~13MHz. Call this methd after begin();
149+
// void setMaxSampleRate() {
150+
// //this is the hack that enables the highest sampling rate possible ~13MHz, have fun
151+
// SET_PERI_REG_BITS(I2S_CLKM_CONF_REG(0), I2S_CLKM_DIV_A_V, 1, I2S_CLKM_DIV_A_S);
152+
// SET_PERI_REG_BITS(I2S_CLKM_CONF_REG(0), I2S_CLKM_DIV_B_V, 1, I2S_CLKM_DIV_B_S);
153+
// SET_PERI_REG_BITS(I2S_CLKM_CONF_REG(0), I2S_CLKM_DIV_NUM_V, 1, I2S_CLKM_DIV_NUM_S);
154+
// SET_PERI_REG_BITS(I2S_SAMPLE_RATE_CONF_REG(0), I2S_TX_BCK_DIV_NUM_V, 1, I2S_TX_BCK_DIV_NUM_S);
155+
// }
156156

157157
/// writes the data to the I2S interface
158158
size_t write(const uint8_t *src, size_t size_bytes) override {

0 commit comments

Comments
 (0)