You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Becky Gibson (JIRA)" <ji...@apache.org> on 2013/02/19 23:13:12 UTC

[jira] [Commented] (CB-571) Check that audio file recording to using Media.startRecord is of type .wav

    [ https://issues.apache.org/jira/browse/CB-571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13581677#comment-13581677 ] 

Becky Gibson commented on CB-571:
---------------------------------

OK - fix is here:  https://github.com/becka11y/cordova-ios/tree/cb571audio

Code is a bit messy in order to provide for backwards support of this convoluted api! 

I split up the code a bit to separate file validation for playing vs recording.  This CHANGES the behavior of create since NO VALIDATION is performed.  I don't see a problem with this since at create time we don't know if the file will be used for playing or recording.  Previously we were treating it like a file for playing and made sure the file existed.

When recording the code now checks for a file extension of wav and errors if it is not correct.

If just a file name is provided for recording (record1.wav), the file is created and stored in the documents/tmp directory.  There is NO automatic creation of dirs. If you pass in myRecordings/record1.wav it will FAIL if documents/tmp/myRecordings dir does not already exist.  I don't see an issue with this, if you want a file in a specific directory, create the dir and file using the file apis.  Providing a full path will work for recording as long as the path exists.  

When playing, the code first looks for files in the www directory BEFORE looking for a previously recorded file in the documents/tmp directory.

Recording supports  documents://<filename.wav>  There is the same restriction on sub-directories,  they must exist in order to record into them. 

I can add more tests to mobile-spec but I don't really see the need since the different platforms all seem to do things a bit differently. I am open to suggestions for additional tests, though.

I plan to submit this for 2.5 in the next day or so.
                
> Check that audio file recording to using Media.startRecord is of type .wav
> --------------------------------------------------------------------------
>
>                 Key: CB-571
>                 URL: https://issues.apache.org/jira/browse/CB-571
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: iOS
>    Affects Versions: 1.6.1
>         Environment: iOS
>            Reporter: Ram Kulkarni
>            Assignee: Becky Gibson
>            Priority: Minor
>              Labels: ios, media
>             Fix For: 2.5.0
>
>
> As we document in {{startRecord}} on our [docs page|http://docs.phonegap.com/en/1.6.1/cordova_media_media.md.html#media.startRecord], when recording audio in iOS, you need to make sure the file exists and that it is of type .wav.
> It would be nice if the {{startRecordingAudio}} method in CDVSound.m checked that the requested file to record to is of the right type, and throw an error if it is not.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira