Results 1 to 7 of 7

Thread: Change size of QAudioBuffer - Problems with QAudioProbe

Threaded View

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

    Exclamation Change size of QAudioBuffer - Problems with QAudioProbe

    I’m doing a project for audio processing in real time. I used the library QAudioRecorder to record and QAudioProbe to process the data. Everything works properly. I plot the result with QWT.

    Captura.jpg


    The problem is that the data buffer stores only 40ms,i change the sampleRate (Fs) and it continue to stores 40ms, 320 samples with 8000Hz or 640 samples with 16000Hz in a mono channel. The problem is that i have to process every 250 ms. I want to change the size of the buffer.. How I can change the buffer size?

    I think I should change this line of code in question, it connect the buffer with the slot Processed.

    Qt Code:
    1. connect (probe, SIGNAL (audioBufferProbed (QAudioBuffer)), this, SLOT (Processed (QAudioBuffer)));
    2. probe-> setSource (Audiorecorder);
    3. audioRecorder.record ();
    To copy to clipboard, switch view to plain text mode 


    I consulted the internet information. I can build a buffer size as desired:
    Qt Code:
    1. QAudioBuffer (int numFrames, QAudioFormat const & format, qint64 startTime = -1)
    To copy to clipboard, switch view to plain text mode 

    I try to do this, define to variables

    Qt Code:
    1. QAudioFormat FORMATO;
    2. const QAudioBuffer Buffer;
    To copy to clipboard, switch view to plain text mode 

    and start it in constructor

    Qt Code:
    1. FORMATO(),
    2. Buffer(400, FORMATO, -1.0) //400 samples for example
    To copy to clipboard, switch view to plain text mode 

    After, i try:

    Qt Code:
    1. connect(probe, SIGNAL(audioBufferProbed(QAudioBuffer)),this, SLOT(Procesado( Buffer)));
    To copy to clipboard, switch view to plain text mode 

    I define the slot like:

    Qt Code:
    1. void Processed(const QAudioBuffer Buffer);
    To copy to clipboard, switch view to plain text mode 

    It compile correctly, but when i run the programe:

    Qt Code:
    1. QObject::connect: No such slot MainWindow::Procesado(const Buffer) in ..\ComparadorAlgoritmosEstimadoresPitch\mainwindow .cpp:182
    2. QObject::connect: (receiver name: 'MainWindow')
    To copy to clipboard, switch view to plain text mode 

    How do I set the buffer to the function of QAudioProbe, audioBufferProbed?

    Thank you very much. Sorry but my english is not very good.
    Attached Images Attached Images
    Last edited by mohabb; 14th November 2014 at 13:27.

Similar Threads

  1. Replies: 3
    Last Post: 21st June 2014, 14:49
  2. Get QAudioBuffer from QMediaPLayer
    By azazaz in forum Qt Programming
    Replies: 2
    Last Post: 18th February 2014, 05:10
  3. change text size and window size - qmessagebox
    By smemamian in forum Newbie
    Replies: 3
    Last Post: 4th July 2013, 07:38
  4. How do you change the size of a QMenubar
    By JonR79 in forum Qt Programming
    Replies: 1
    Last Post: 21st November 2008, 23:15
  5. change font size and button size of QMessageBox
    By nass in forum Qt Programming
    Replies: 6
    Last Post: 13th September 2006, 19:16

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.