acid-drop- Hacking the planet from a LilyGo T-Deck using custom firmware |
git clone git://git.acid.vegas/acid-drop.git |
Log | Files | Refs | Archive | README | LICENSE |
internalDAC.ino (1612B)
1 //********************************************************************************************************** 2 //* audioI2S-- I2S audiodecoder for ESP32, internal DAC example * 3 //********************************************************************************************************** 4 // 5 // Sep.09/2022 6 // 7 // THE SOFTWARE IS PROVIDED "AS IS" FOR PRIVATE USE ONLY, IT IS NOT FOR COMMERCIAL USE IN WHOLE OR PART OR CONCEPT. 8 // FOR PERSONAL USE IT IS SUPPLIED WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 9 // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR 10 // OR COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 11 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE 12 // 13 14 #include "Arduino.h" 15 #include "WiFiMulti.h" 16 #include "Audio.h" 17 18 Audio audio(true, I2S_DAC_CHANNEL_BOTH_EN); 19 WiFiMulti wifiMulti; 20 String ssid = "xxxxx"; 21 String password = "xxxxx"; 22 23 void setup() { 24 Serial.begin(115200); 25 WiFi.mode(WIFI_STA); 26 wifiMulti.addAP(ssid.c_str(), password.c_str()); 27 wifiMulti.run(); 28 if(WiFi.status() != WL_CONNECTED){ 29 WiFi.disconnect(true); 30 wifiMulti.run(); 31 } 32 audio.setVolume(12); // 0...21 33 34 audio.connecttohost("http://mp3.ffh.de/radioffh/hqlivestream.mp3"); // 128k mp3 35 } 36 37 void loop() 38 { 39 audio.loop(); 40 } 41 42 void audio_info(const char *info){ 43 Serial.print("info "); Serial.println(info); 44 }