Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-30345

QAudioOutput in Qt5 is not producing any sound

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P2: Important
    • None
    • 5.0.1
    • Multimedia
    • None
    • Linux goldorak 3.5.0-25-generic #39-Ubuntu SMP Mon Feb 25 18:26:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

      kubuntu 12.10 + KDE-4.10.1 + Alsa

      qt-opensource-5.0.1-x86

    Description

      There is no sound output in any mumtimedia examples provided when it comes to sound (e.g.: the spectrum demo)

      On another hand video plays correctly with sound.

      This example does not works neither :

      QAudioOutput_test
      QVector <double> * soundData = SoundGenerator::getSound();
       
          soundBuffer->open(QIODevice::ReadWrite);
          QDataStream writeStream(soundBuffer);
          foreach(double d, *soundData) {
              char value = d * (2 << 7);
              //  qDebug() << "Value : " << (short int)value;
              writeStream << value;
          }
       
          QAudioFormat format;
          // Set up the format, eg.
          format.setSampleRate(SoundGenerator::getAudioSampleRate());
          format.setChannelCount(1);
          format.setSampleSize(8);
          format.setCodec("audio/pcm");
          format.setByteOrder(QAudioFormat::LittleEndian);
          format.setSampleType(QAudioFormat::SignedInt);
          QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
       
          audio = new QAudioOutput(format, this);
          if (audio->error() != QAudio::NoError) {
              qDebug() << "Problem playing sound";
          }
       
          connect(audio, SIGNAL(stateChanged(QAudio::State)), this, SLOT(aboutToFinish(QAudio::State)));
          audio->start(soundBuffer);
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            janichol Andy Nichols
            fredaime Frédéric Aime
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes