You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Simon MacDonald (JIRA)" <ji...@apache.org> on 2012/08/08 17:30:21 UTC

[jira] [Created] (CB-1211) Media record uses a .mp3 extension when it is a .3gp file

Simon MacDonald created CB-1211:
-----------------------------------

             Summary: Media record uses a .mp3 extension when it is a .3gp file
                 Key: CB-1211
                 URL: https://issues.apache.org/jira/browse/CB-1211
             Project: Apache Cordova
          Issue Type: Bug
          Components: Android
    Affects Versions: 2.0.0
            Reporter: Simon MacDonald
            Assignee: Simon MacDonald
            Priority: Minor
             Fix For: 2.1.0


Hi, I am analyzing the files generated on SD card after the completion of recording.

The recording is implemented using "my_media.startRecord();". 

So I looked into the Java code of Cordova and found that PhoneGap will create something called "tmprecording.mp3" and I assume that PhoneGap encodes the output of the recording in mp3. 

I opened the generated file(which was playable with correct sound) and found something interesting:

1. It was neither one of MEPGI/II/III. The first 11 bits of the file I got are all 0s. 
2. It was not a .wav file. The first four bytes should be "RIFF" in ASCII for a legal .wav file, which was not the case on the file I got. 

For project requirement, I need to verify the sampling rate and bit rate of the mp3 file generated. However, even though I use some mp3 checker software, I cannot retrieve these information from the file generated. 

After that I use the media player to play the file, and tried monitoring which decoder the player used, and got the following information:

Input: amrnb, mono, 8000 HZ, 128kbps (libavcodec)
Output:  PCM, Stereo, 8000HZ, 16-bit integer

Is that the correct information I wanted to know? Which one of them indicates the correct sampling rate and bit rate? Does anyone know what format specifically the recorded file is and where I can find its spec(such as header, etc)?
Later I need to manipulate the recorded file (e.g., retrieve simple waveform). Really appreciate your help.

I don't know if it is only me(HTC One X and Nexus Glaxy) or everyone, but the file format is eventually confirmed as MP4/3GP. The file I got from PhoneGap recording is encoded with 3GP release 4 codec because it has the header "00 00 00 18 66 74 79 70 33 67
" in hex. This seems very different from a MPEG-3 file format and I don't understand why PhoneGap Cordova team will name such file as *.mp3. Is this behavior system/browser-related on different device or universal to all Cordova apps?


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (CB-1211) Media record uses a .mp3 extension when it is a .3gp file

Posted by "Simon MacDonald (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CB-1211?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simon MacDonald resolved CB-1211.
---------------------------------

    Resolution: Fixed

Temp file extension is now .3gp.
                
> Media record uses a .mp3 extension when it is a .3gp file
> ---------------------------------------------------------
>
>                 Key: CB-1211
>                 URL: https://issues.apache.org/jira/browse/CB-1211
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 2.0.0
>            Reporter: Simon MacDonald
>            Assignee: Simon MacDonald
>            Priority: Minor
>             Fix For: 2.1.0
>
>
> Hi, I am analyzing the files generated on SD card after the completion of recording.
> The recording is implemented using "my_media.startRecord();". 
> So I looked into the Java code of Cordova and found that PhoneGap will create something called "tmprecording.mp3" and I assume that PhoneGap encodes the output of the recording in mp3. 
> I opened the generated file(which was playable with correct sound) and found something interesting:
> 1. It was neither one of MEPGI/II/III. The first 11 bits of the file I got are all 0s. 
> 2. It was not a .wav file. The first four bytes should be "RIFF" in ASCII for a legal .wav file, which was not the case on the file I got. 
> For project requirement, I need to verify the sampling rate and bit rate of the mp3 file generated. However, even though I use some mp3 checker software, I cannot retrieve these information from the file generated. 
> After that I use the media player to play the file, and tried monitoring which decoder the player used, and got the following information:
> Input: amrnb, mono, 8000 HZ, 128kbps (libavcodec)
> Output:  PCM, Stereo, 8000HZ, 16-bit integer
> Is that the correct information I wanted to know? Which one of them indicates the correct sampling rate and bit rate? Does anyone know what format specifically the recorded file is and where I can find its spec(such as header, etc)?
> Later I need to manipulate the recorded file (e.g., retrieve simple waveform). Really appreciate your help.
> I don't know if it is only me(HTC One X and Nexus Glaxy) or everyone, but the file format is eventually confirmed as MP4/3GP. The file I got from PhoneGap recording is encoded with 3GP release 4 codec because it has the header "00 00 00 18 66 74 79 70 33 67
> " in hex. This seems very different from a MPEG-3 file format and I don't understand why PhoneGap Cordova team will name such file as *.mp3. Is this behavior system/browser-related on different device or universal to all Cordova apps?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira