jAudioFeatureExtractor.jAudioTools
クラス AudioFormatJFrame

java.lang.Object
  上位を拡張 java.awt.Component
      上位を拡張 java.awt.Container
          上位を拡張 java.awt.Window
              上位を拡張 java.awt.Frame
                  上位を拡張 javax.swing.JFrame
                      上位を拡張 jAudioFeatureExtractor.jAudioTools.AudioFormatJFrame
すべての実装されたインタフェース:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class AudioFormatJFrame
extends javax.swing.JFrame
implements java.awt.event.ActionListener

JFrame used to select encoding options for recording or synthsizing audio. These options include sampling rate, bit depth, number of channels, whether samples are signed or not and byte order. Note that only PCM encoding is accounted for here. Not all sound cards will support all settings.

Options that are not available on the radio buttons can be entered in the text fields. The contents of text fields are ignored unless the corresponding Other radio button is selected

The Low Quality Settings, Mid Quality Settings and High Quality Settings buttons set the GUI settings to pre-defined defaults.

It is not necessary to press the OK button in order for changes to be accessible to external classes. However, pressing the Cancel button will restore settings to those that were selected when the JFrame was last made visible.

The GUI settings may be set or accessed externally by the setAudioFormat and getAudioFormat methods respectively.

This class also includes several static methods that are unrelated to the GUI settings. These include the getStandardLowQualityRecordAudioFormat, getStandardMidQualityRecordAudioFormat and getStandardHighQualityRecordAudioFormat methods which return default AudioFormat presets corresponding to the buttons with similar names. The defineAudioFormat static method does the same thing as the basic PCM AudioFormat constructor, but is better documented.

作成者:
Cory McKay
関連項目:
直列化された形式

入れ子のクラスの概要
 
クラス javax.swing.JFrame から継承された入れ子のクラス/インタフェース
javax.swing.JFrame.AccessibleJFrame
 
クラス java.awt.Frame から継承された入れ子のクラス/インタフェース
java.awt.Frame.AccessibleAWTFrame
 
クラス java.awt.Window から継承された入れ子のクラス/インタフェース
java.awt.Window.AccessibleAWTWindow
 
クラス java.awt.Container から継承された入れ子のクラス/インタフェース
java.awt.Container.AccessibleAWTContainer
 
クラス java.awt.Component から継承された入れ子のクラス/インタフェース
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
フィールドの概要
 
クラス javax.swing.JFrame から継承されたフィールド
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
クラス java.awt.Frame から継承されたフィールド
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
クラス java.awt.Component から継承されたフィールド
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
インタフェース javax.swing.WindowConstants から継承されたフィールド
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
インタフェース java.awt.image.ImageObserver から継承されたフィールド
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
コンストラクタの概要
AudioFormatJFrame()
          Basic constructor.
 
メソッドの概要
 void actionPerformed(java.awt.event.ActionEvent event)
          Calls the appropriate methods when the buttons are pressed.
static javax.sound.sampled.AudioFormat defineAudioFormat(float sample_rate, int sample_size, int channels, boolean signed, boolean big_endian)
          Returns a new AudioFormat with the given parameters.
 javax.sound.sampled.AudioFormat getAudioFormat(boolean allow_text_selections)
          Gets the AudioFormat corresponding to the settings on the GUI.
static javax.sound.sampled.AudioFormat getStandardHighQualityRecordAudioFormat()
          Returns a new mono AudioFormat that uses an 44.1 kHz sampling rate, a 16 bit bit-depth (signed) and big endian linear PCM encoding.
static javax.sound.sampled.AudioFormat getStandardLowQualityRecordAudioFormat()
          Returns a new mono AudioFormat that uses an 8 kHz sampling rate, a 8 bit bit-depth (signed) and big endian linear PCM encoding.
static javax.sound.sampled.AudioFormat getStandardMidQualityRecordAudioFormat()
          Returns a new mono AudioFormat that uses an 8 kHz sampling rate, a 8 bit bit-depth (signed) and big endian linear PCM encoding.
 void setAudioFormat(javax.sound.sampled.AudioFormat audio_format)
          Sets GUI settings to those of a pre-defined AudioFormat.
 void setVisible(boolean b)
          Makes this JFrame visible or hidden, exactly as the inherited setVisible method does.
 
クラス javax.swing.JFrame から継承されたメソッド
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
クラス java.awt.Frame から継承されたメソッド
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated
 
クラス java.awt.Window から継承されたメソッド
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, show, toBack, toFront
 
クラス java.awt.Container から継承されたメソッド
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
クラス java.awt.Component から継承されたメソッド
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
インタフェース java.awt.MenuContainer から継承されたメソッド
getFont, postEvent
 

コンストラクタの詳細

AudioFormatJFrame

public AudioFormatJFrame()
Basic constructor. Configures the panel and its fields to low quality audio. Prepares the JFrame, but does not show it. The setVisible method must be called externally to show this.

メソッドの詳細

getStandardLowQualityRecordAudioFormat

public static javax.sound.sampled.AudioFormat getStandardLowQualityRecordAudioFormat()
Returns a new mono AudioFormat that uses an 8 kHz sampling rate, a 8 bit bit-depth (signed) and big endian linear PCM encoding.

This audio format is a typical format for use when recording low-quality audio from a microphone.


getStandardMidQualityRecordAudioFormat

public static javax.sound.sampled.AudioFormat getStandardMidQualityRecordAudioFormat()
Returns a new mono AudioFormat that uses an 8 kHz sampling rate, a 8 bit bit-depth (signed) and big endian linear PCM encoding.

This audio format is a typical format for use when recording low-quality audio from a microphone.


getStandardHighQualityRecordAudioFormat

public static javax.sound.sampled.AudioFormat getStandardHighQualityRecordAudioFormat()
Returns a new mono AudioFormat that uses an 44.1 kHz sampling rate, a 16 bit bit-depth (signed) and big endian linear PCM encoding.

This audio format is a typical format for use when recording low-quality audio from a microphone.


defineAudioFormat

public static javax.sound.sampled.AudioFormat defineAudioFormat(float sample_rate,
                                                                int sample_size,
                                                                int channels,
                                                                boolean signed,
                                                                boolean big_endian)
Returns a new AudioFormat with the given parameters. This object describes the particular arrangement of data in a sound stream.

Linear PCM encoding is used automatically. An alternative constructory of AudioFormat can be used if a different encoding is desired.

This method does not do anything that a basic AudioFormat constructor does not already do. The purpose of this method is to give better documentation.

The possible parameters given below may varay from sound card to sound card, and others may be available as well.

パラメータ:
sample_rate - Number of samples per second. Standard values are 8000,11025,16000,22050 or 44100.
sample_size - Number of bits per sample. Standard values are 8 or 16.
channels - Number of channels. Standard values are 1 or 2.
signed - True if data is signed, false if not.
big_endian - True if data is big endian, false if small endian.
戻り値:
A linear PCM encoded AudioFormat with the specified parameters.

setAudioFormat

public void setAudioFormat(javax.sound.sampled.AudioFormat audio_format)
Sets GUI settings to those of a pre-defined AudioFormat. Does nothing if null is passed to parameter. IMPORTANT: Only PCM encoding is made possible in this GUI.

パラメータ:
audio_format - The AudioFormat to base GUI values on.

getAudioFormat

public javax.sound.sampled.AudioFormat getAudioFormat(boolean allow_text_selections)
                                               throws java.lang.Exception
Gets the AudioFormat corresponding to the settings on the GUI. Note that only PCM encoding is possible.

パラメータ:
allow_text_selections - If this is not set to true, then this method will throw an exception if the "Other" radio button is selected for one or more of the sampling rate, bit depth or number of channels. If this parameter is set to false, then an exception will not be thrown.
戻り値:
The AudioFormat corresponding to the GUI settings.
例外:
java.lang.Exception - Throws an exception if the allow_text_selections parameter is true and the "Other" radio button is selected for one or more of the sampling rate, bit depth or number of channels.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)
Calls the appropriate methods when the buttons are pressed.

定義:
インタフェース java.awt.event.ActionListener 内の actionPerformed
パラメータ:
event - The event that is to be reacted to.

setVisible

public void setVisible(boolean b)
Makes this JFrame visible or hidden, exactly as the inherited setVisible method does. Also temporarily stores the currently selected settings on the GUI if the window the parameter is true.

オーバーライド:
クラス java.awt.Window 内の setVisible
パラメータ:
b - Show if true, hide if false.