com.speech4j.speech
Class MMDevice

java.lang.Object
  |
  +--com.speech4j.speech.NativeObject
        |
        +--com.speech4j.speech.MMDevice

public class MMDevice
extends NativeObject

MCI functions wrapper. Partially exports MCI API.

Version:
1.1
Author:
Pavel Vlasov

Constructor Summary
MMDevice(java.lang.String devName)
          Creates new MCI device.
 
Method Summary
 void close()
          Closes MCI device.
 void destroy()
          Destroys corresponding native object (MCI device).
protected  void finalize()
          Invokes destroy() to destroy native object.
 java.lang.String getAlias()
          Returns MCI device alias.
 int getDeviceNumber()
          Returns MCI device number.
 void record()
          Starts recording.
 void save(java.lang.String fileName)
          Saves data to file
static java.lang.String sendString(java.lang.String command)
          Sends a command to MCI device.
 void setPCM(byte bits, byte channels, int samples)
          Sets PCM (Pulse Code Modulation) parameters
 void stop()
          Stops recording.
 
Methods inherited from class com.speech4j.speech.NativeObject
bytes2String, cleanup, getObjID, processMessages, stopProcessingMessages, string2Bytes, testSpeech
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MMDevice

public MMDevice(java.lang.String devName)
         throws SpeechException
Creates new MCI device.

Parameters:
devName - Device name.
Throws:
SpeechException
Method Detail

finalize

protected void finalize()
Invokes destroy() to destroy native object.

Overrides:
finalize in class java.lang.Object

getDeviceNumber

public int getDeviceNumber()
Returns MCI device number.

Returns:
Device number

getAlias

public java.lang.String getAlias()
Returns MCI device alias.

Returns:
Alias

destroy

public void destroy()
Destroys corresponding native object (MCI device).


save

public void save(java.lang.String fileName)
          throws SpeechException
Saves data to file

Parameters:
fileName - File name
SpeechException

setPCM

public void setPCM(byte bits,
                   byte channels,
                   int samples)
            throws SpeechException
Sets PCM (Pulse Code Modulation) parameters

Parameters:
bits - Bits per sample.
channels - Number of channels.
samples - Number of samples per second.
SpeechException

record

public void record()
            throws SpeechException
Starts recording.

SpeechException

close

public void close()
Closes MCI device.


stop

public void stop()
          throws SpeechException
Stops recording.

SpeechException

sendString

public static java.lang.String sendString(java.lang.String command)
                                   throws SpeechException
Sends a command to MCI device.

Parameters:
command - MCI command.
Returns:
Error description.
SpeechException


Copyright © 2003 Pavel Vlasov. All Rights Reserved.