# arts Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# KAudioRecordStream Class Reference

A KDE wrapper around Synth_AMAN_RECORD/AudioToByteStream/ByteSoundReceiver. More...

`#include <kaudiorecordstream.h>`

Inheritance diagram for KAudioRecordStream:

[legend]
Collaboration diagram for KAudioRecordStream:

[legend]
List of all members.

## 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@kde.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:

  | parent | You probably want to pass the KArtsServer as parent so that the stream will be deleted before the Arts server disappears

Definition at line 57 of file kaudiorecordstream.cpp.

References QObject::connect(), and kdFatal().

## Member Function Documentation

int KAudioRecordStream::read | ( | char * | ,
|  | 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.

References data(), endl(), k_funcinfo, and kdDebug().

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

| 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.

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

read blocking I/O setting

See also:
  setBlockingIO()

Definition at line 132 of file kaudiorecordstream.cpp.

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

| 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. References flush().

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

read whether polling is enabled

See also:
  usePolling()

Definition at line 144 of file kaudiorecordstream.cpp.

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

Returns:
  The Effect Stack right after the Synth_AMAN_RECORD.

Definition at line 149 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.

Referenced by start(), and stop().

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. References endl(), k_funcinfo, kdDebug(), and running().

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.

References QObject::connect(), data(), endl(), k_funcinfo, kdDebug(), kdWarning(), and running().

void KAudioRecordStream::flush | ( |  | ) | `[slot]`

| flush input buffer Definition at line 214 of file kaudiorecordstream.cpp. References endl(), k_funcinfo, and kdDebug(). Referenced by usePolling().

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

Referenced by read(), and start().

void KAudioRecordStream::running | ( | bool |  | ) | `[signal]`

Wether this RecordStream is recording or not.

Since:
  3.2

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

- kaudiorecordstream.h
- kaudiorecordstream.cpp

This file is part of the documentation for arts Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:27:58 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003