PortAudio: com.portaudio.BlockingStream Class Reference

PortAudio 2.0

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions
com.portaudio.BlockingStream Class Reference

## Public Member Functions
native int | getReadAvailable ()
native int | getWriteAvailable ()
boolean | read (float[] buffer, int numFrames)
boolean | write (float[] buffer, int numFrames)
boolean | read (short[] buffer, int numFrames)
boolean | write (short[] buffer, int numFrames)
native void | start ()
native void | stop ()
native void | abort ()
native void | close ()
native boolean | isStopped ()
native boolean | isActive ()
String | toString ()
native double | getTime ()
StreamInfo | getInfo ()

## Detailed Description

Represents a stream for blocking read/write I/O.

This Java object contains the pointer to a PortAudio stream stored as a long. It is passed to PortAudio when calling stream related functions.

To create one of these, call PortAudio.openStream().

See Also
  PortAudio

Author
  Phil Burk

Definition at line 59 of file BlockingStream.java.

## Member Function Documentation

native void com.portaudio.BlockingStream.abort | ( |  | ) |

Stop immediately and lose any data that was written but not played.

native void com.portaudio.BlockingStream.close | ( |  | ) |

Close the stream and zero out the pointer. Do not reference the stream after this.

Referenced by com.portaudio.PlaySine.play().

native int com.portaudio.BlockingStream.getReadAvailable | ( |  | ) |

Returns
  number of frames that can be read without blocking.

native double com.portaudio.BlockingStream.getTime | ( |  | ) |

Get audio time related to this stream. Note that it may not start at 0.0.

native int com.portaudio.BlockingStream.getWriteAvailable | ( |  | ) |

Returns
  number of frames that can be written without blocking.

boolean com.portaudio.BlockingStream.read | ( | float[] | buffer,
|  | int | numFrames
| ) |  |
| inline

Read 32-bit floating point data from the stream into the array.

Parameters

  buffer |
  numFrames | number of frames to read

Returns
  true if an input overflow occurred

Definition at line 93 of file BlockingStream.java.

References com.portaudio.PortAudio.FORMAT_FLOAT_32.

boolean com.portaudio.BlockingStream.read | ( | short[] | buffer,
|  | int | numFrames
| ) |  |
| inline

Read 16-bit integer data to the stream from the array.

Parameters

  buffer |
  numFrames | number of frames to write

Returns
  true if an input overflow occurred

Definition at line 134 of file BlockingStream.java.

native void com.portaudio.BlockingStream.start | ( |  | ) |

Atart audio I/O.

Referenced by com.portaudio.PlaySine.play().

native void com.portaudio.BlockingStream.stop | ( |  | ) |

Wait for the stream to play all of the data that has been written then stop.

Referenced by com.portaudio.PlaySine.play().

boolean com.portaudio.BlockingStream.write | ( | float[] | buffer,
|  | int | numFrames
| ) |  |
| inline

Write 32-bit floating point data to the stream from the array. The data should be in the range -1.0 to +1.0.

Parameters

  buffer |
  numFrames | number of frames to write

Returns
  true if an output underflow occurred

Definition at line 112 of file BlockingStream.java.

References com.portaudio.PortAudio.FORMAT_FLOAT_32.

boolean com.portaudio.BlockingStream.write | ( | short[] | buffer,
|  | int | numFrames
| ) |  |
| inline

Write 16-bit integer data to the stream from the array.

Parameters

  buffer |
  numFrames | number of frames to write

Returns
  true if an output underflow occurred

Definition at line 152 of file BlockingStream.java.

The documentation for this class was generated from the following file:

- BlockingStream.java