From d4838c0d86dbe44af049d187956d32501c8d3a03 Mon Sep 17 00:00:00 2001 From: Tom Early Date: Wed, 15 Dec 2021 06:03:45 -0700 Subject: [PATCH] writing binary 101 --- Controller.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Controller.cpp b/Controller.cpp index 4bfcf67..31f3d79 100644 --- a/Controller.cpp +++ b/Controller.cpp @@ -426,11 +426,10 @@ void CController::AppendWave(const std::shared_ptr packet) co { std::stringstream sstr; sstr << std::hex << ntohs(packet->GetStreamId()) << ".raw"; - std::ofstream pcmfile(sstr.str(), std::ofstream::binary); + std::ofstream pcmfile(sstr.str(), std::ofstream::app | std::ofstream::binary); if (pcmfile.good()) { - for (unsigned int i=0; i<160; i++) - pcmfile << packet->GetAudio()[i]; + pcmfile.write(reinterpret_cast(packet->GetAudio()), 320); pcmfile.close(); }