KAudio Class Reference

[kdeutils Index] [kdeutils Hierarchy] [Headers]


The KAudio class is a very easy means to playback digital audio data More...

#include <kaudio.h>

Inherits: QObject (qt)

Public Members

Signals


Detailed Description

The KAudio class is a very easy means to playback digital audio data. A standard procedure looks like this example:

// Class definition class DemoClient : public KTopLevelWidget { Q_OBJECT public: DemoClient(); KAudio KAServer;

public slots: void playOK(); // [...] }

// Program // ************* Initialization ****************************** DemoClient *myClient = new DemoClient(); if (myClient->KAServer.serverStatus()) { cerr << "Failed contacting audio server\n"; exit (1); }

// ************* If you want to recieve Qt signals *********** KAServer.setSignals(true); QObject::connect(&KAServer, SIGNAL(playFinished()), this, SLOT(playOK()));

// ************* Playback ************************************ KAServer.play("/my/sounds/is/here.wav");

See democlient.cpp in the kdebase sources for a full program showing more possibilities of the KAudio class


KAudio() [public]

Create an Audio player

bool play() [public]

Play the Wav last set via setFilename(filename) or play(filename)

bool play(const char *filename) [public]

Set filename as current media name and play it

bool play(QString& filename) [public]

Set filename as current media name and play it

bool setFilename(const char *filename) [public]

Set the "current" Filename. This file can be played later with ::play()

bool setFilename(QString& filename) [public]

Set the "current" Filename. This file can be played later with ::play()

void setAutosync(bool autosync) [public]

If true is given, every play call is synced directly.

void setSignals(bool sigs=true) [public]

If you want to recieve a Qt signal when your media is finished, you mustcall setSignals(true) before you play your media.

bool stop() [public]

Stop current media

void sync() [public]

Sync media. This effectively blocks the calling process until themedia is played fully

int serverStatus() [public]

Query Server status. 0 means OK. You MUST check server status aftercreating a KAudio object.

void playFinished() [signal]

Signal gets emitted after current media has been finished. This signal only gets emitted, if setSignals(true) was called before. Do not forget to include this signal in your own derived class if you want signals.


Documentation generated by tasin@cd1 on Die Nov 30 17:32:19 CET 1999
Kdoc