- Nem indul és mi a baja a gépemnek topik
- Intel Core i5 / i7 / i9 "Alder Lake-Raptor Lake/Refresh" (LGA1700)
- AMD Ryzen 9 / 7 / 5 7***(X) "Zen 4" (AM5)
- 3D nyomtatás
- Gaming notebook topik
- Hajlított gamer monitorral támad a TCL
- Autós kamerák
- TCL LCD és LED TV-k
- Milyen asztali (teljes vagy fél-) gépet vegyek?
- LG LCD és LED TV-k
Hirdetés
-
Itt az első olyan, MI-re kiélezett laptop, ami ellenáll a környezeti hatásoknak
ph A széleskörűen konfigurálható újdonságból remek választás kerekedhet a zordabb körülmények közepette végzett, helyszíni munkákhoz.
-
Ha Trump győz, Elon Musk politikai tanácsadó lehet
it A jelentések szerint Donald Trump azt fontolgatja, hogy politikai tanácsadót csinál Elon Muskból, amennyiben megnyeri a novemberi választást.
-
Remekül néz ki a szögletes Z Fold6
ma Kémfotókon csodálható meg az S24 Ultra vonásaival érkező hajlítható.
Új hozzászólás Aktív témák
-
bagarol
junior tag
Egyszerű webrádió esp32-vel, nem kell hozzá külső alkatrész. Mono, belső DAC, kijelző nélkül.
Soros konzolon lehet beírni a rádió címét, egyből elkezdi lejátszani, stop-ra leáll, lehet új címet megadni. DAC2-őn (gpio26) adja ki a jelet.Nekem konyhába így is megfelel, persze kijelzővel + egyebek, úgy értem, hogy mono, belső dac. Az esp8266audio[link] library kell hozzá.
Ellenőrizni nem tudtam,nincs most esp32-m, remélem működik.#include <WiFi.h>
#include <AudioFileSource.h>
#include <AudioFileSourceBuffer.h>
#include <AudioFileSourceICYStream.h>
#include <AudioGeneratorMP3.h>
#include <AudioOutputI2S.h>const char* ssid = "";
const char* password = "";
String s;
char URL[96];
const int preallocateBufferSize = 32*1024;
const int preallocateCodecSize = 29192;
void *preallocateBuffer = NULL;
void *preallocateCodec = NULL;
AudioGeneratorMP3 *mp3;
AudioFileSourceICYStream *file;
AudioFileSourceBuffer *buff;
AudioOutputI2S *out;void setup() {
preallocateBuffer = malloc(preallocateBufferSize);
if (!preallocateBuffer) {
Serial.begin(115200);
Serial.printf_P(PSTR("FATAL ERROR: Unable to preallocate %d bytes for app\n"), preallocateBufferSize);
while (1) delay(1000);
}
Serial.begin(115200);
initwifi();
Serial.printf("STATUS(System) Ready \n\n");
out = new AudioOutputI2S(0, 1);
out->SetOutputModeMono(true);
out->SetGain(0.5);
}void loop() {
if(Serial.available()){
s = Serial.read();
if(s == "stop") StopPlaying();
else if(s.startsWith("http://")) {
s.trim();
s.toCharArray(URL,s.length()+1);
StartPlaying();
}
}
}void StartPlaying() {
file = new AudioFileSourceICYStream(URL);
file->RegisterMetadataCB(MDCallback, (void*)"ICY");
buff = new AudioFileSourceBuffer(file, preallocateBuffer, preallocateBufferSize);
buff->RegisterStatusCB(StatusCallback, (void*)"buffer");
out = new AudioOutputI2S(0, 1);
out->SetOutputModeMono(true);
out->SetGain(0.5);
mp3 = new AudioGeneratorMP3(preallocateCodec, preallocateCodecSize);
mp3->RegisterStatusCB(StatusCallback, (void*)"mp3");
mp3->begin(buff, out);
Serial.printf("STATUS(URL) %s \n", URL);
Serial.flush();
}void StopPlaying() {
if (mp3) {
mp3->stop();
delete mp3;
mp3 = NULL;
}
if (buff) {
buff->close();
delete buff;
buff = NULL;
}
if (file) {
file->close();
delete file;
file = NULL;
}
Serial.printf("STATUS(Stopped)\n");
Serial.flush();
}void initwifi() {
WiFi.disconnect();
WiFi.softAPdisconnect(true);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
Serial.println("Connecting to WiFi");
delay(1000);
}
Serial.println("Connected to WiFi");
}void MDCallback(void *cbData, const char *type, bool isUnicode, const char *string) {
const char *ptr = reinterpret_cast<const char *>(cbData);
(void) isUnicode;
char s1[32], s2[64];
strncpy_P(s1, type, sizeof(s1));
s1[sizeof(s1) - 1] = 0;
strncpy_P(s2, string, sizeof(s2));
s2[sizeof(s2) - 1] = 0;
Serial.printf("METADATA(%s) '%s' = '%s'\n", ptr, s1, s2);
Serial.flush();
}void StatusCallback(void *cbData, int code, const char *string) {
const char *ptr = reinterpret_cast<const char *>(cbData);
char s1[64];
strncpy_P(s1, string, sizeof(s1));
s1[sizeof(s1) - 1] = 0;
Serial.printf("STATUS(%s) '%d' = '%s'\n", ptr, code, s1);
Serial.flush();
}[ Szerkesztve ]
Új hozzászólás Aktív témák
- Új Lenovo Ideapad Pro 5 Profi Gyors Laptop -30% 16" RYZEN 5 7535HS 16/512 2,5K Radeon 2GB 120Hz
- Macbook Pro 15 2018 16/512 Radeon Pro 560X
- Lenovo ThinkPad P53s i7-8565U 8x4.6Ghz/32Gb DDR4/512SSD/Nvidia P520/15,6" Workstation Laptop
- Tervezői Dell Precision 7520,15.6",FHD,i7-7820HQ,32GB DDR4,512GB SSD,4GB VGA,WIN11 Laptop Notebook
- XPS 9320 27% ÁFA 13.4" FHD+ IPS érintő i7-1360P 16GB 512GB NVMe ujjolv IR kam., gar
Állásajánlatok
Cég: Alpha Laptopszerviz Kft.
Város: Pécs
Cég: Promenade Publishing House Kft.
Város: Budapest