Wednesday, September 11, 2013

Audio Recorder Module

Audio Recorder module helps to record audio without using intent in Android. Using this module we can record audio in different format like(mp4,3gp) without help of intent. This module uses MediaRecorder class to record audio.

Titanium Audio Recorder Module

Features and Benefits
  • File format
    Module support for both mp4 and 3gp formats.
  • Audio Encoders
    Module support for following audio encoder types AAC, AMR_NB, AMR_WB, DEFAULT
  • External Storage
    It saves output file in external storage inside the specified directory
  • maxDuration
    Option to stop the recording session after the specified duration
  • maxFileSize
    Option to stop the recording session after the specified file size

var audioRecorder = require("titutorial.audiorecorder");

    outputFormat : audioRecorder.OutputFormat_THREE_GPP,
    audioEncoder : audioRecorder.AudioEncoder_AMR_NB,
    directoryName : "testdir",
    fileName : "testfile",
    maxFileSize : 7000,
    success : function(e) {
        alert("success => " + e.filePath);"response is => " + JSON.stringify(e));
        var audioDir = Titanium.Filesystem.getFile(Titanium.Filesystem.externalStorageDirectory, "testdir");
        var audioFile = Ti.Filesystem.getFile(audioDir.resolve(), e.fileName);"audioFile.nativePath = " + audioFile.nativePath);
    error : function(d) {
        alert("error => " + e.message);"error is => " + JSON.stringify(d));

Source Code:

iPhone NavigationGroup in Alloy

In this post I am going to share how to use iPhone NavigationGroup in Alloy project.

In Titanium this method used to create the NavigationGroup. Following example also covers below things
  • Creating NavigationGroup
  • Opening a new window in NavigationGroup
  • Closing NavigationGroup
iPhone NavigationGroup Example

 Example App: