コード例 #1
0
    /**
     * Stops the transfer of media data from this <tt>AbstractBufferStream</tt>.
     *
     * @throws IOException if anything goes wrong while stopping the transfer of media data from
     *     this <tt>AbstractBufferStream</tt>
     * @see AbstractBufferStream#stop()
     */
    @Override
    public void stop() throws IOException {
      synchronized (this) {
        if (audioRecord != null) {
          audioRecord.stop();
          setThreadPriority = true;
        }
      }

      super.stop();
    }
コード例 #2
0
    /**
     * Starts the transfer of media data from this <tt>AbstractBufferStream</tt>.
     *
     * @throws IOException if anything goes wrong while starting the transfer of media data from
     *     this <tt>AbstractBufferStream</tt>
     * @see AbstractBufferStream#start()
     */
    @Override
    public void start() throws IOException {
      /*
       * Connect upon start because the connect has been delayed to allow
       * this AudioRecordStream to respect requests to set its format.
       */
      synchronized (this) {
        if (audioRecord == null) connect();
      }

      super.start();

      synchronized (this) {
        if (audioRecord != null) {
          setThreadPriority = true;
          audioRecord.startRecording();
        }
      }
    }