diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 4aac3e48..a25a88c0 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -13,6 +13,7 @@
+
diff --git a/assets/gap.js b/assets/gap.js
index 30236518..d3e95af7 100644
--- a/assets/gap.js
+++ b/assets/gap.js
@@ -306,7 +306,29 @@ var Device = {
get: function(url, file) {
window.DroidGap.httpGet(url, file);
}
+ },
+
+ audio: {
+ startRecording: function(file) {
+ window.DroidGap.startRecordingAudio(file);
+ },
+ stopRecording: function() {
+ window.DroidGap.stopRecordingAudio();
+ },
+ startPlaying: function(file) {
+ window.DroidGap.startPlayingAudio(file);
+ },
+ stopPlaying: function() {
+ window.DroidGap.stopPlayingAudio();
+ },
+ getCurrentPosition: function() {
+ return window.DroidGap.getCurrentPositionAudio();
+ },
+ getDuration: function(file) {
+ return window.DroidGap.getDurationAudio(file);
+ }
}
+
}
function gotLocation(lat, lon) {
diff --git a/assets/index.html b/assets/index.html
index d069a134..9a92f19d 100644
--- a/assets/index.html
+++ b/assets/index.html
@@ -105,10 +105,32 @@ function onReceiveSms(number, message)
http = function(func)
{
if (func == 'get') {
- Device.http.get($('httpGetUrl').value, $('httpGetFile').value)
+ Device.http.get($('httpGetUrl').value, $('httpGetFile').value);
}
}
+audio = function(func)
+{
+ if (func == 'startPlaying') {
+ Device.audio.startPlaying($('audioFile').value);
+ } else
+ if (func == 'stopPlaying') {
+ Device.audio.stopPlaying();
+ } else
+ if (func == 'startRecording') {
+ Device.audio.startRecording($('audioFile').value);
+ } else
+ if (func == 'stopRecording') {
+ Device.audio.stopRecording();
+ } else
+ if (func == 'getCurrentPosition') {
+ $('posdur').value = Device.audio.getCurrentPosition();
+ } else
+ if (func == 'getDuration') {
+ $('posdur').value = Device.audio.getDuration($('audioFile').value);
+ }
+}
+
addLoadEvent(initGap);
@@ -130,6 +152,7 @@ addLoadEvent(initGap);
Vibration
Play Sound
Photo...
+ Audio...
Notification...
HTTP...
About
@@ -289,4 +312,39 @@ addLoadEvent(initGap);
+
+
Audio
+
+
+
+
+
+
+
+