user1403947
user1403947

Reputation:

Phonegap Media.startRecord() Audio Format

What is Phonegap's Media.startRecord() recording format and sample rate? Is the format different per platform?

mediaRec = new Media("test.mp3", onSuccess, onError);

mediaRec.startRecord();

When I try to convert the file from MP3 to WAV with lame, it gives me an error.

Upvotes: 2

Views: 3587

Answers (3)

Joe Stanton
Joe Stanton

Reputation: 11

The encoding isn't as simple as just amr (at least from my experience). On my Droid Razr (4.1.2) and my work's Samsung Galaxy Tab 2 (4.1.1) the formats were amr. On my co-workers Droid Razr M (4.2.x) the format was qcelp. On another work tablet, Asus ME301T (4.1.1), records in AAC

Reference: Fighting with phonegap for the last week (Sorry that is my best reference)

Upvotes: 1

Ajmal VH
Ajmal VH

Reputation: 1691

In android platform Media.startRecord() record audio in MP3 format. In iOS it records in WAV format and that is the only choice. If you want record in other additional format such as AMR in android use

navigator.device.capture.captureAudio( 
CaptureCB captureSuccess, CaptureErrorCB captureError,  [CaptureAudioOptions options]

);

Reference: http://docs.phonegap.com/en/1.0.0/phonegap_media_capture_capture.md.html#capture.captureAudio

Upvotes: 8

user1403947
user1403947

Reputation:

Turns out that the encoding depends on the platform. So on android, the encoding is AMR.

Reference: http://developer.android.com/guide/appendix/media-formats.html

Upvotes: 3

Related Questions