Results 1 to 2 of 2

Thread: Problem with QMediaPlayer and QAudioProbe

  1. #1
    Join Date
    Nov 2014
    Location
    GRANADA
    Posts
    4
    Thanks
    3
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Exclamation Problem with QMediaPlayer and QAudioProbe

    Thanks for reading my post .

    I am developing a small project to process audio. The program allows both read an .mp3 file or record sound from the microphone .

    While playing or recording shows the user the energy of the signal and the spectrum.
    When I want to record sound I use QAudioRecorder and everything works properly. The problem is that if I want to read an .mp3 file does not work.I have a problem connecting QMediaPlayer and QAudioProbe.
    Qt Code:
    1. mediaPlayer=new QMediaPlayer(this);
    2. audioProbe = new QAudioProbe(this);
    3.  
    4. if (audioProbe->setSource(mediaPlayer)) {
    5. // Probing succeeded, audioProbe->isValid() should be true.
    6. connect(audioProbe, SIGNAL(audioBufferProbed(QAudioBuffer)),
    7. this, SLOT(calculateLevel(QAudioBuffer)));
    8. cout << "All work correctly" << endl;
    9. }else{
    10. cout << "Some problems" << endl;
    11. }
    12. mediaPlayer->setMedia(fileSelected);
    13. mediaPlayer->setVolume(50);
    14. mediaPlayer->play();
    To copy to clipboard, switch view to plain text mode 
    The sound is played correctly but I fail to connect with QAudioProbe . How I can connect it? Thanks.

  2. #2
    Join Date
    May 2015
    Posts
    3
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: Problem with QMediaPlayer and QAudioProbe

    Could you get this fixed, I have the same problem?

Similar Threads

  1. Replies: 6
    Last Post: 21st November 2014, 11:25
  2. Timecode in QMediaPlayer
    By mkarol in forum Qt Programming
    Replies: 1
    Last Post: 5th December 2013, 18:50
  3. QMediaPlayer problems
    By alenn.masic in forum Qt Programming
    Replies: 1
    Last Post: 25th February 2013, 16:32
  4. Replies: 1
    Last Post: 9th December 2011, 08:17
  5. videoplayer problem in qmediaplayer
    By vinayaka in forum Newbie
    Replies: 3
    Last Post: 25th August 2011, 13:44

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.