- minor improvements
This commit is contained in:
parent
55a31060ec
commit
cc5b704997
|
|
@ -554,7 +554,6 @@ void AgentImpl::processGetMediaStats(Json::Value& request, Json::Value& answer)
|
||||||
#if defined(USE_AQUA_LIBRARY)
|
#if defined(USE_AQUA_LIBRARY)
|
||||||
if (includeAqua)
|
if (includeAqua)
|
||||||
{
|
{
|
||||||
// Send recorded audio to upper level
|
|
||||||
answer["incoming_audio"] = mAquaIncoming.hexstring();
|
answer["incoming_audio"] = mAquaIncoming.hexstring();
|
||||||
|
|
||||||
ICELogInfo(<< "Running AQuA analyzer.");
|
ICELogInfo(<< "Running AQuA analyzer.");
|
||||||
|
|
|
||||||
|
|
@ -246,7 +246,7 @@ unsigned WavFileReader::size() const
|
||||||
#define BITS_PER_CHANNEL 16
|
#define BITS_PER_CHANNEL 16
|
||||||
|
|
||||||
WavFileWriter::WavFileWriter()
|
WavFileWriter::WavFileWriter()
|
||||||
:mHandle(nullptr), mLengthOffset(0), mRate(AUDIO_SAMPLERATE), mChannels(1)
|
:mHandle(nullptr), mLengthOffset(0), mRate(AUDIO_SAMPLERATE), mChannels(1), mWritten(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -126,13 +126,18 @@ std::string ByteBuffer::comment()
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string ByteBuffer::hexstring()
|
std::string ByteBuffer::hexstring()
|
||||||
|
{
|
||||||
|
return toHex(mDataPtr, mDataSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string ByteBuffer::toHex(const void* bytes, size_t len)
|
||||||
{
|
{
|
||||||
std::string result;
|
std::string result;
|
||||||
result.resize(mDataSize * 2, (char)0xCC);
|
result.resize(len * 2, (char)0xCC);
|
||||||
for (std::vector<uint8_t>::size_type index = 0; index < mDataSize; index++)
|
for (std::vector<uint8_t>::size_type index = 0; index < len; index++)
|
||||||
{
|
{
|
||||||
char value[3];
|
char value[3];
|
||||||
sprintf(value, "%02X", (unsigned char)mDataPtr[index]);
|
sprintf(value, "%02X", (unsigned char)((const unsigned char*)bytes)[index]);
|
||||||
result[index*2] = value[0];
|
result[index*2] = value[0];
|
||||||
result[index*2+1] = value[1];
|
result[index*2+1] = value[1];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,9 @@ namespace ice
|
||||||
void setComment(std::string comment);
|
void setComment(std::string comment);
|
||||||
std::string comment();
|
std::string comment();
|
||||||
std::string hexstring();
|
std::string hexstring();
|
||||||
|
|
||||||
|
static std::string toHex(const void* bytes, size_t len);
|
||||||
|
|
||||||
void reserve(size_t capacity);
|
void reserve(size_t capacity);
|
||||||
void insertTurnPrefix(unsigned short prefix);
|
void insertTurnPrefix(unsigned short prefix);
|
||||||
void truncate(size_t newsize);
|
void truncate(size_t newsize);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue