You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by st...@apache.org on 2017/02/21 23:10:27 UTC

[3/4] cordova-plugin-media git commit: Make the output file of Android an acc file.

Make the output file of Android an acc file.

In order to play the audio file with the html <audio> tag in iOS:
1. change OutputFormat from RAW_AMR to AAC_ADTS
2. change OutputFormat from AMR_NB to AAC

Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/commit/c6c59cc0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/c6c59cc0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/c6c59cc0

Branch: refs/heads/master
Commit: c6c59cc0a6ae44671fe69766c04e44ba18606239
Parents: 55d457b
Author: happy2discover <ha...@users.noreply.github.com>
Authored: Thu Jan 5 13:37:04 2017 +0800
Committer: Steve Gill <st...@gmail.com>
Committed: Tue Feb 21 14:58:07 2017 -0800

----------------------------------------------------------------------
 src/android/AudioPlayer.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/c6c59cc0/src/android/AudioPlayer.java
----------------------------------------------------------------------
diff --git a/src/android/AudioPlayer.java b/src/android/AudioPlayer.java
index 9d25a79..d46f4b4 100644
--- a/src/android/AudioPlayer.java
+++ b/src/android/AudioPlayer.java
@@ -151,8 +151,8 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
             this.audioFile = file;
             this.recorder = new MediaRecorder();
             this.recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
-            this.recorder.setOutputFormat(MediaRecorder.OutputFormat.RAW_AMR); // THREE_GPP);
-            this.recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); //AMR_NB);
+            this.recorder.setOutputFormat(MediaRecorder.OutputFormat.AAC_ADTS); // RAW_AMR);
+            this.recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC); //AMR_NB);
             this.tempFile = generateTempFile();
             this.recorder.setOutputFile(this.tempFile);
             try {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org