Well, smth like this i was saw in tutorial, but i wanted to save in one of the readable formats for music player. Is it possible?
file = new QFile("smth.raw");
file->open(QIODevice::WriteOnly | QIODevice::Truncate );
QAudioFormat format;
format.setFrequency(8000);
format.setChannels(1);
format.setSampleSize(8);
format.setCodec("audio/pcm");
format.setByteOrder(QAudioFormat::LittleEndian);
format.setSampleType(QAudioFormat::UnSignedInt);
QAudioDeviceInfo info = QAudioDeviceInfo::defaultInputDevice();
if (!info.isFormatSupported(format)) {
qWarning()<<"default format not supported try to use nearest";
format = info.nearestFormat(format);
}
audioInput = new QAudioInput(format, this);
Well, if it interesting for somebody, that’s algorithm to convert. If you have the better idea, please, reply!