×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Super Contributor
    Join Date
    May 2006
    Location
    Beijing,China
    Posts
    1,190

    can not record the sound

    code can run without error, but no sound file saved.
    code below:

    Code:
       audioSource = new QAudioCaptureSource;
        recorder = new QMediaRecorder(audioSource);
    
        QAudioEncoderSettings audioSettings;
        audioSettings.setCodec("audio/wav");
    //    audioSettings.setQuality(QtMedia::HighQuality);   //comment out this line, compile will error.
        recorder->setEncodingSettings(audioSettings);
        recorder->setOutputLocation(QUrl::fromLocalFile("E:\\mysound\\background.wav"));
        recorder->record();
    I created a folder in E drive called mysound, but no sound file is saved.
    [I][COLOR="Orange"]xhsoldier[/COLOR][/I]
    [email]xhsoldier@gmail.com[/email]/[email]xhsoldier@163.com[/email]

  2. #2
    Regular Contributor
    Join Date
    Oct 2008
    Location
    Oslo, Norway
    Posts
    329

    Re: can not record the sound

    Hi,

    I believe "audio/wav" is incorrect as a codec, it refers to container format. Use one of the strings returned by supportedAudioCodecs instead (e.g. "PCM"). Also, try constructing the output location QUrl directly - without using fromLocalFile() - the backend may have problems with 'file://' scheme. Check how things are done in the audiorecorder example.

  3. #3
    Registered User
    Join Date
    Jul 2010
    Posts
    2

    Re: can not record the sound

    [UPDATE: It records the file under: c:\data; you can get the output file by calling capture.outputLocation().toString()]
    Hi, I'm facing the same problem, even changing the codec string into "PCM" and the QUrl("qml//test.wav"), what do you think can help me? Thanks
    Last edited by alva93; 2012-06-26 at 22:08.

  4. #4
    Registered User
    Join Date
    Nov 2011
    Posts
    80

    Re: can not record the sound

    I also had some problems using paths, because Symbian uses a '\' as separator and Qt uses '/'.
    So i would try this path instead: QUrl::fromLocalFile("E:/mysound/background.wav")

Similar Threads

  1. How to Record Sound On N900
    By nmwifaq in forum Series 40 & S60 Platform Feedback Archive
    Replies: 2
    Last Post: 2010-02-04, 21:57
  2. Record sound and playback
    By dakz in forum Mobile Java Media (Graphics & Sounds)
    Replies: 20
    Last Post: 2008-06-26, 10:29
  3. Sound Record
    By ovvenkatesan in forum Symbian Media (Closed)
    Replies: 3
    Last Post: 2007-11-26, 04:13
  4. record sound
    By cars2004 in forum Mobile Java General
    Replies: 2
    Last Post: 2005-03-24, 02:15

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×