KAudioRecordStream Class Reference

`#include <kaudiorecordstream.h>`

Inherits QObject.

## Public Slots

void | stop ()
void | start (int samplingRate, int bits, int channels)
void | flush ()

## Signals

void | data (QByteArray &data)
void | running (bool)

## Public Member Functions

| KAudioRecordStream (KArtsServer *server, const QString &title, QObject *parent=0, const char *name=0)
int | read (char *, int size)
void | setBlockingIO (bool)
bool | blockingIO () const
void | usePolling (bool)
bool | polling () const
Arts::StereoEffectStack | effectStack () const
bool | running () const

## Detailed Description

A KDE wrapper around Synth_AMAN_RECORD/AudioToByteStream/ByteSoundReceiver.

Author
  Matthias Kretz kretz.nosp@m.@kde.nosp@m..org

Since
  3.2

Definition at line 41 of file kaudiorecordstream.h.

## Constructor & Destructor Documentation

KAudioRecordStream::KAudioRecordStream | ( | KArtsServer * | server,
|  | const QString & | title,
|  | QObject * | parent = `0`,
|  | const char * | name = `0`
| ) |  |

Construct a KAudioRecordStream.

Parameters

  server | The server where it should record from.
  title | The title that is shown in the AudioManager.
  parent | You will propably want to pass the server as parent to so this stream gets deleted before the server disappears.
  name | The name of the stream.

Definition at line 57 of file kaudiorecordstream.cpp.

## Member Function Documentation

bool KAudioRecordStream::blockingIO | ( |  | ) | const

read blocking I/O setting

See also
  setBlockingIO()

Definition at line 132 of file kaudiorecordstream.cpp.

void KAudioRecordStream::data | ( | QByteArray & | data | ) |

signal

Data from the aRts server has arrived.

You should copy the data because the passed QByteArray will be deleted right after returning from your slot(s).

Parameters

  data | the data from the server

Arts::StereoEffectStack KAudioRecordStream::effectStack | ( |  | ) | const

Returns
  The Effect Stack right after the Synth_AMAN_RECORD.

Definition at line 149 of file kaudiorecordstream.cpp.

void KAudioRecordStream::flush | ( |  | ) |

slot

flush input buffer

Definition at line 214 of file kaudiorecordstream.cpp.

bool KAudioRecordStream::polling | ( |  | ) | const

read whether polling is enabled

See also
  usePolling()

Definition at line 144 of file kaudiorecordstream.cpp.

int KAudioRecordStream::read | ( | char * | buffer,
|  | int | size
| ) |  |

You can read `size` number of bytes.

If blockingIO() is set the method will return as soon as it has all your data and could possibly block your program. The method returns the number of bytes that are actually in the buffer.

See also
  usePolling()

Definition at line 96 of file kaudiorecordstream.cpp.

bool KAudioRecordStream::running | ( |  | ) | const

Returns
  Wether it is running (recording) or not.

Since
  3.2

Definition at line 154 of file kaudiorecordstream.cpp.

void KAudioRecordStream::running | ( | bool |  | ) |

signal

Wether this RecordStream is recording or not.

Since
  3.2

void KAudioRecordStream::setBlockingIO | ( | bool | blocking | ) |

If you set blockingIO to true the read method will wait until it has enough data to return exactly what you asked for.

If blockingIO is false you can count on having control back to your program soon enough

Definition at line 127 of file kaudiorecordstream.cpp.

void KAudioRecordStream::start | ( | int | samplingRate,
|  | int | bits,
|  | int | channels
| ) |  |

slot

Attach to the soundserver and start getting data to read.

This method must be called as soon as you want to receive data. In any case you have to call start() before read()

Parameters

  samplingRate | The sampling rate the stream should be resampled to. Use a number between 500 and 2000000.
  bits | The number of bits the stream should have. Only 8 and 16 Bits are supported.
  channels | The number of channels (mono/stereo). Only 1 and 2 are supported.

Definition at line 178 of file kaudiorecordstream.cpp.

void KAudioRecordStream::stop | ( |  | ) |

slot

Detaches the stream from the soundserver but doesn't remove the Synth_AMAN_RECORD so that the entry in the Audiomanager remains.

Definition at line 159 of file kaudiorecordstream.cpp.

void KAudioRecordStream::usePolling | ( | bool | polling | ) |

If you want to poll for data using read() set this to true.

If you'd rather not poll use the data() signal for asynchronous I/O. If you set polling to true and don't call read() or flush() the inputbuffer will grow endlessly.

The default is false (if you want to use read() set this to true).

Definition at line 137 of file kaudiorecordstream.cpp.

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

- kaudiorecordstream.h
- kaudiorecordstream.cpp

KDE Home | KDE Accessibility Home | Description of Access Keys