@SGaist
sir,
sir, thank you very much for the clue you give.i fixed the problem in the application and it works fine.The working code is given below.
i did the following steps to fix the problem.
reduced the input volume by using QAudinput :: setVolume(0.009) function.
converted the *data to to qint8 from uchar
input_G->setVolume(0.009);
xy_device = new XYSeriesIODevice(this,m_series);
xy_device->open(QIODevice::WriteOnly);
//if crash check m_series is null
input_G->start(xy_device);
}
qint64 XYSeriesIODevice::writeData(const char *data, qint64 maxSize)
{
static const int resolution = 4;
if (m_buffer.isEmpty()) {
m_buffer.reserve(sampleCount);
for (int i = 0; i < sampleCount; ++i)
m_buffer.append(QPointF(i, 0));
}
int start = 0;
const int availableSamples = int(maxSize) / resolution;
if (availableSamples < sampleCount) {
start = sampleCount - availableSamples;
for (int s = 0; s < start; ++s)
m_buffer[s].setY(m_buffer.at(s + availableSamples).y());
}
for (int s = start; s < sampleCount; ++s, data += resolution){
qreal y=qreal(qint8(*data))/qreal(128);
m_buffer[s].setY(y*.75);}
m_series->replace(m_buffer);
return (sampleCount - start) * resolution;
}