Module for Audio recording and playing
View the Project on GitHub shivakumars/Titanium-Android-Audio-Recorder-and-Player
Audio recorder and player for Titanium Android
Version 0.1
Version 0.2
Please note that this Module is under development. You can download the zip from here
Add this into Android Manifest.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
Include the Module in TiApp.xml and
// open a single window
var win = Ti.UI.createWindow({
backgroundColor:'white',
layout:'vertical'
});
var button1 = Ti.UI.createButton({
title:'Record'
});
win.add(button1);
var button2 = Ti.UI.createButton({
title:'Play'
});
win.add(button2);
win.open();
// TODO: write your module tests here
var audiorecorder = require('in.shivakumars.audiorecorder');
Ti.API.info("module is => " + audiorecorder);
var path='';
button1.addEventListener('click',function(e){
if(button1.title=='Record')
{
button1.title='Stop Recording';
audiorecorder.startRec('sample.mp4',true);
}
else
{
button1.title='Record';
path=audiorecorder.stopRec();
}
});
button2.addEventListener('click',function(e){
if(button2.title=='Play')
{
button2.title='Stop';
audiorecorder.startPlay(path);
}
else
{
button2.title='Play';
path=audiorecorder.stopPlay();
}
});
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/LICENSE-2.0