how to configure streams-memory-audiokit #614
-
Hi Phil. I didn't see an example for memory streams to the audiokit's earphone jack so I'm trying unsuccessfully to modify the streams-memory-i2s sketch.
*/ #include "AudioTools.h" MemoryStream mp3(zero_mp3, zero_mp3_len); void setup(){ // begin processing void loop(){ /* if (mp3.available()) { ` |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 5 replies
-
This does not make any sense: if you do not change the cfg.output_device you should get output on both the speaker and on the earphone! If you add a kit.processActions() to the loop the system will detect if you plugged in the earphones and will deactivate the speakers automatically. |
Beta Was this translation helpful? Give feedback.
-
Just define the output device! |
Beta Was this translation helpful? Give feedback.
-
Not sure if this is what you meant but it didn't work. #define AUDIO_CODEC_DEFAULT_CONFIG(){ |
Beta Was this translation helpful? Give feedback.
-
Definitly no! just add cfg.output_device = AUDIO_HAL_DAC_OUTPUT_LINE1!
|
Beta Was this translation helpful? Give feedback.
-
` @copyright Copyright (c) 2021 */ uint8_t channels = 1; AudioKitStream kit; void setup() { AudioLogger::instance().begin(Serial, AudioLogger::Info); } void loop() { } AudioLibs/AudioKit.h: In member function 'virtual void audio_tools::AudioKitStream::setAudioInfo(audio_tools::AudioBaseInfo)': AudioLibs/AudioKit.h:275:11: error: 'class AudioKit' has no member named 'setSampleRate' AudioKit.h: In member function 'audio_tools::AudioActions::ActiveLogic audio_tools::AudioKitStream::getActionLogic(int)': AudioLibs/AudioKit.h:582:16: error: 'PERIPH_ID_ADC_BTN' was not declared in this scope |
Beta Was this translation helpful? Give feedback.
-
it (streams-memory_raw-i2s_external_dac.ino) compiles and works with Setvolume but raw files are pretty big so honestly I'd rather get the sketch in the original post working. I tried your suggestion above , something else is still wrong. Help please. `
*/ #include "AudioTools.h" MemoryStream mp3(zero_mp3, zero_mp3_len); void setup(){ auto cfg = kit.defaultConfig(TX_MODE); void loop(){ |
Beta Was this translation helpful? Give feedback.
-
What do you mean with something is wrong ? |
Beta Was this translation helpful? Give feedback.
-
Entire code below. I've gotten it to compile once but my audiokit was not connected at the time. Since then haven't been able to get it to compile. Same error messages from my previous post: AudioLibs/AudioKit.h:275:11: error: 'class AudioKit' has no member named 'setSampleRate' AudioKit.h: In member function 'audio_tools::AudioActions::ActiveLogic audio_tools::AudioKitStream::getActionLogic(int)': AudioLibs/AudioKit.h:582:16: error: 'PERIPH_ID_ADC_BTN' was not declared in this scope. `
*/ #include "AudioTools.h" MemoryStream mp3(zero_mp3, zero_mp3_len); void setup(){ // begin processing void loop(){ } |
Beta Was this translation helpful? Give feedback.
-
I got it to compile but all I hear is static through audiokit earphone jack. [I] I2SConfig.h : 104 - rx/tx mode: TX_MODE |
Beta Was this translation helpful? Give feedback.
-
I could not reproduce your issue. However, I noticed that the current logic is overwriting the setting of output_device and was giving an output to both the speaker and the earphones, whatever settings were used. |
Beta Was this translation helpful? Give feedback.
-
Are you saying the code exactly as I posted it my last post compiles with no errors and gives audio. |
Beta Was this translation helpful? Give feedback.
-
Yes, it has always been giving output to the earphones |
Beta Was this translation helpful? Give feedback.
This does not make any sense: if you do not change the cfg.output_device you should get output on both the speaker and on the earphone!
If you add a kit.processActions() to the loop the system will detect if you plugged in the earphones and will deactivate the speakers automatically.