Results 1 to 2 of 2

Thread: how to do recording and playback in the device ?

  1. #1
    Join Date
    Jul 2012
    Posts
    9
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Post how to do recording and playback in the device ?

    Hi,
    I am tried to do recording and playback .its working in the simulator but not in the device .
    so please go through my code .Please suggest me what i need to change in my code.


    Qt Code:
    1. void MyTajweedScr::toggleRecord()
    2. {
    3. QString fileName;
    4. if (capture->state() == QMediaRecorder::StoppedState)
    5. {
    6.  
    7. if (!outputLocationSet)
    8. // capture->setOutputLocation(generateAudioFilePath());
    9.  
    10. // QAudioEncoderSettings settings;
    11.  
    12. QAudioEncoderSettings audioSettings;
    13.  
    14.  
    15. capture->setEncodingSettings(audioSettings);
    16. capture->setOutputLocation(QUrl::fromLocalFile(fileName));
    17. capture->record();
    18. }
    19.  
    20. else
    21. {
    22. capture->stop();
    23. }
    24. }
    25. void MyTajweedScr::setOutputLocation()
    26. {
    27. QString fileName =QFileDialog::getSaveFileName();//"E:/New folder/Project6 - Copy/IQRAV1/song/text.pcm";////;
    28. capture->setOutputLocation(QUrl(fileName));
    29. outputLocationSet = true;
    30. }
    31. void MyTajweedScr::on_Record_tb_clicked()
    32. {
    33.  
    34. setOutputLocation();
    35. toggleRecord();
    36. }
    To copy to clipboard, switch view to plain text mode 


    Regards,
    Arpita

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: how to do recording and playback in the device ?

    How about you tell us which bit fails and how it fails?

    Commenting out lines 8 and 10 changes the entire function of the if() at line 7. Is this really the code that is "working in the simulator?"

Similar Threads

  1. mp3 audio recording
    By dhe in forum Qt Programming
    Replies: 1
    Last Post: 26th August 2012, 10:00
  2. Audio Recording in qt
    By BalaQT in forum Qt Programming
    Replies: 8
    Last Post: 12th September 2009, 09:01
  3. Audio Recording with Phonon
    By Nemo in forum Qt Programming
    Replies: 4
    Last Post: 12th June 2008, 06:31
  4. Recording Replaying
    By mgurbuz in forum Qt Programming
    Replies: 1
    Last Post: 12th March 2008, 21:17
  5. recording and replaying
    By samirg in forum Qt Programming
    Replies: 1
    Last Post: 11th September 2007, 09:49

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
  •  
Qt is a trademark of The Qt Company.