1

I want to get a RTP audio stream coming from an Axis Camera and then play it back in real time in my Qt project.

I'm using Live555 in order to manage the audio stream and decode it with FFMPEG. When I decode a packet I emit a signal that is managed inside a slot of my widget with:

ap.ioDevice->write((const char*)ptrArr, frameSize);

The problem is that when I listen, my voice but a little bit metallic! I set these parameters for the QAudioOutput:

format.setFrequency(22050);
format.setChannels(1);
format.setSampleSize(16);
format.setCodec("audio/pcm");
format.setByteOrder(QAudioFormat::LittleEndian);
format.setSampleType(QAudioFormat::UnSignedInt);

What's wrong?


Thank you to all.

As I said in a comment I'm able to obtain an enough clear playback with 8000Hz and 2 channels.

Now I'm trying to solve other problems and than I'll try to improve audio quality for example with Phonon.

Kev
  • 118,037
  • 53
  • 300
  • 385
user1047400
  • 45
  • 1
  • 2
  • 8
  • According to [the docs](http://doc.qt.nokia.com/stable/qaudioformat-obsolete.html), `setFrequency` and `setChannels` are both obsolete and only included for legacy purposes. I'm not sure that its the source of your problem, but it would be best practice to use `setSampleRate` and `setChannelCount` instead. – sam-w Nov 15 '11 at 11:22
  • OK, I tried to use setSampleRate and setChannelCount but the effect is the same. I set it with 8000 and 2 channels and now works really better. I only would like to reduce low frequencies. Do you know how I can do that? – user1047400 Nov 16 '11 at 08:32
  • Yes, I wouldn't have though there would be a difference, but since `setFrequency` is now listed as obsolete, there is a chance it could be dropped altogether in future releases of Qt, meaning that if you updated your code could break :) – sam-w Nov 16 '11 at 08:34
  • Regarding your request above for how to reduce low frequencies. I think your best bet is to use the [Phonon module](http://doc.qt.nokia.com/stable/phonon-module.html) - specifically [`Phonon::Effect`](http://doc.qt.nokia.com/stable/phonon-effect.html) – sam-w Nov 16 '11 at 08:40

1 Answers1

0

I think your problem is to do with your sample rate - 22KHz seems very low. How much of a difference does upping it to 44.1K make? (I think you'll also need to check that QAudioDeviceInfo::supportedSampleRates().contains((int)SampleRate) for whatever you choose as your SampleRate).

sam-w
  • 7,478
  • 1
  • 47
  • 77