writing binary 101

main
Tom Early 4 years ago
parent d2cf1cf2c6
commit d4838c0d86

@ -426,11 +426,10 @@ void CController::AppendWave(const std::shared_ptr<CTranscoderPacket> packet) co
{ {
std::stringstream sstr; std::stringstream sstr;
sstr << std::hex << ntohs(packet->GetStreamId()) << ".raw"; 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()) if (pcmfile.good())
{ {
for (unsigned int i=0; i<160; i++) pcmfile.write(reinterpret_cast<char *>(packet->GetAudio()), 320);
pcmfile << packet->GetAudio()[i];
pcmfile.close(); pcmfile.close();
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.