mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-08 12:37:01 +03:00
20 lines
499 B
C++
20 lines
499 B
C++
#include "NamedPipeAudioSink.h"
|
|
|
|
#include <stdio.h> // for printf
|
|
|
|
NamedPipeAudioSink::NamedPipeAudioSink() {
|
|
printf("Start\n");
|
|
this->namedPipeFile = std::ofstream("outputFifo", std::ios::binary);
|
|
printf("stop\n");
|
|
}
|
|
|
|
NamedPipeAudioSink::~NamedPipeAudioSink() {
|
|
this->namedPipeFile.close();
|
|
}
|
|
|
|
void NamedPipeAudioSink::feedPCMFrames(const uint8_t* buffer, size_t bytes) {
|
|
// Write the actual data
|
|
this->namedPipeFile.write((char*)buffer, (long)bytes);
|
|
this->namedPipeFile.flush();
|
|
}
|