com.mot.iden.voicenote
Class VoiceNote

java.lang.Object
  extended bycom.mot.iden.voicenote.VoiceNote

public class VoiceNote
extends Object

Provides access to voicenote functions


Field Summary
static int AMBE_VOCODER
          Integer used to select the AMBE (12:1) vocoder.
static int VSELP_VOCODER
          Integer used to select the VSELP (6:1) vocoder.
 
Method Summary
static int availableTime()
          Deprecated. Replaced by availableTime(int vocoder)
static int availableTime(int vocoder)
          Returns the available time in seconds using a selected vocoder availableTime is not supported on Gemini product.
static void delete(String filename)
          Deletes a voicenote
static String[] directory()
          Returns a list of available voicenotes
static int getSize(String filename)
          Gets the file size in bytes
static void play(String filename)
          Plays a voicenote
static byte[] readFile(String filename)
          Reads voicenote data from a file and writes it to a byte array
static void record(String filename)
          Deprecated. Replaced by record(String filename int vocoder)
static void record(String filename, int vocoder)
          Records a voicenote using a selected vocoder AMBE_VOCODER is not supported on Gemini product.
static void rename(String oldname, String newname)
          Renames a voicenote
static void stop()
          Stops playing or recording a voicenote
static void writeFile(String filename, byte[] buffer)
          Reads voicenote data from a byte array and writes it to a file
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VSELP_VOCODER

public static final int VSELP_VOCODER
Integer used to select the VSELP (6:1) vocoder. This is the only vocoder available for phones prior to i90c.

See Also:
Constant Field Values

AMBE_VOCODER

public static final int AMBE_VOCODER
Integer used to select the AMBE (12:1) vocoder. This is available on i90c phones and later. This is not supported on Gemini product.

See Also:
Constant Field Values
Method Detail

play

public static final void play(String filename)
                       throws IllegalArgumentException,
                              IOException,
                              VoiceNoteException
Plays a voicenote

Parameters:
filename - String containing the desired filename
Throws:
IllegalArgumentException - if the filename is invalid
IOException - if the filename does not exist
VoiceNoteException - if the player can't be created, or if the operations on the player fail.

record

public static final void record(String filename)
                         throws IllegalArgumentException,
                                IOException,
                                VoiceNoteException
Deprecated. Replaced by record(String filename int vocoder)

Records a voicenote using legacy vocoder (6:1)

Parameters:
filename - String containing the desired filename
Throws:
IllegalArgumentException - if the filename is invalid or not unique
IOException - if an error occurs during record
VoiceNoteException - if the player can't be created, or if the operations on the player fail.

record

public static final void record(String filename,
                                int vocoder)
                         throws IllegalArgumentException,
                                IOException,
                                VoiceNoteException
Records a voicenote using a selected vocoder AMBE_VOCODER is not supported on Gemini product.

Parameters:
filename - String containing the desired filename
vocoder - int vocoder type
Throws:
IllegalArgumentException - if the vocoder is invalid, or if the filename is invalid or not unique.
IOException - if an error occurs during record
VoiceNoteException - if the player can't be created, or if the operations on the player failed.

stop

public static final void stop()
                       throws VoiceNoteException
Stops playing or recording a voicenote

Throws:
VoiceNoteException - if an I/O error occurs during recordControl.commit().

delete

public static final void delete(String filename)
                         throws IllegalArgumentException,
                                IOException,
                                VoiceNoteException
Deletes a voicenote

Parameters:
filename - String containing the filename to delete
Throws:
IllegalArgumentException - if filename is invalid
IOException - if file does not exist
VoiceNoteException - if the player is not stopped.

availableTime

public static final int availableTime()
                               throws IOException
Deprecated. Replaced by availableTime(int vocoder)

Returns the available time in seconds using the legacy vocoder (6:1)

Throws:
IOException - if the value is not available

availableTime

public static final int availableTime(int vocoder)
                               throws IllegalArgumentException,
                                      IOException
Returns the available time in seconds using a selected vocoder availableTime is not supported on Gemini product.

Parameters:
vocoder - int vocoder type
Throws:
IllegalArgumentException - if the vocoder is invalid
IOException - if the value is not available

rename

public static final void rename(String oldname,
                                String newname)
                         throws IllegalArgumentException,
                                IOException,
                                VoiceNoteException
Renames a voicenote

Parameters:
oldname - String containing the old filename
newname - String containing the new filename
Throws:
IllegalArgumentException - if either filename is invalid
IOException - if the old file does not exist, or if there is an error during rename.
VoiceNoteException - if the player is not stopped.

directory

public static final String[] directory()
                                throws IOException
Returns a list of available voicenotes

Returns:
String Array containing the names of available files
Throws:
IOException - if no files exist

readFile

public static final byte[] readFile(String filename)
                             throws IOException,
                                    VoiceNoteException
Reads voicenote data from a file and writes it to a byte array

Parameters:
filename - String Array containing the name of the file to read
Returns:
Byte Array containing the voicenote data
Throws:
IOException - if the file does not exist
VoiceNoteException - if the player is not stopped.

getSize

public static final int getSize(String filename)
                         throws IOException
Gets the file size in bytes

Parameters:
filename - String Array containing the name of the file
Returns:
int Size of the file in bytes
Throws:
IOException - If the file does not exist

writeFile

public static final void writeFile(String filename,
                                   byte[] buffer)
                            throws IOException,
                                   VoiceNoteException
Reads voicenote data from a byte array and writes it to a file

Parameters:
filename - String Array containing the name of the file to write
buffer - Byte Array containing the voicenote data
Throws:
IOException - if the file could not be written
VoiceNoteException - if the player is not stopped.