This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <DHT.h> | |
#include <ESP8266WiFi.h> | |
#include <ESP8266WebServer.h> | |
#define DHTPIN 2 | |
#define DHTTYPE DHT11 | |
#define LEDPIN 14 | |
ESP8266WebServer server(80); | |
DHT dht(DHTPIN, DHTTYPE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ShortBuffer mSamples; // the samples to play | |
int mNumSamples; // number of samples to play | |
void playAudio() { | |
new Thread(new Runnable() { | |
@Override | |
public void run() { | |
int bufferSize = AudioTrack.getMinBufferSize(SAMPLE_RATE, AudioFormat.CHANNEL_OUT_MONO, | |
AudioFormat.ENCODING_PCM_16BIT); | |
if (bufferSize == AudioTrack.ERROR || bufferSize == AudioTrack.ERROR_BAD_VALUE) { |
NewerOlder