cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Becky Gibson (JIRA)" <>
Subject [jira] [Commented] (CB-571) Check that audio file recording to using Media.startRecord is of type .wav
Date Tue, 19 Feb 2013 22:13:12 GMT


Becky Gibson commented on CB-571:

OK - fix is here:

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:
>             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|],
when recording audio in iOS, you need to make sure the file exists and that it is of type
> 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:

View raw message