Skip to content

Commit 0f187dd

Browse files
committed
HLS example
1 parent fc725fe commit 0f187dd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

examples/examples-communication/hls/hls-buffer-i2s/hls-buffer-i2s.ino

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
//
22
// Buffered playback of HLSStream: activate PSRAM!
3-
// We use a MultiDecoder to handle different formats
3+
// We use a MultiDecoder to handle different formats.
4+
// For HLS you need to set the log level to Warning or higher.
45
//
56

67
#include "AudioTools.h"
78
#include "AudioTools/AudioLibs/HLSStream.h"
89
#include "AudioTools/AudioCodecs/CodecHelix.h"
10+
#include "AudioTools/AudioCodecs/CodecMTS.h"
911
#include "AudioTools/Concurrency/RTOS.h"
1012
//#include "AudioTools/AudioLibs/AudioBoardStream.h"
1113

@@ -18,6 +20,8 @@ HLSStream hls_stream("ssid", "password");
1820
// decoder
1921
MP3DecoderHelix mp3;
2022
AACDecoderHelix aac;
23+
MTSDecoder mts(aac); // MPEG-TS (MTS) decoder
24+
2125
MultiDecoder multi(hls_stream); // MultiDecoder using mime from hls_stream
2226
EncodedAudioOutput dec(&out, &multi);
2327

@@ -39,6 +43,7 @@ void setup(void) {
3943

4044
multi.addDecoder(mp3, "audio/mpeg");
4145
multi.addDecoder(aac, "audio/aac");
46+
multi.addDecoder(mts, "video/MP2T"); // MPEG-TS
4247

4348
auto cfg = out.defaultConfig(TX_MODE);
4449
out.begin(cfg);

0 commit comments

Comments
 (0)