# class KAudioPlayer | This class provides one-shot-and-forget audio playing. More...
Definition | `#include <kaudioplayer.h>`
Inherits | QObject (qt) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- KAudioPlayer ( const QString& filename, QObject* parent = 0, const char* name = 0 )
- ~KAudioPlayer ()

#### Public Slots

- void play ()

#### Public Static Methods

- static void play (QString filename)

## Detailed Description

This class provides one-shot-and-forget audio playing. You will never know if what you wanted to play really got played.

It doesn't require linking any special libraries, as it operates over DCOP. In the current implementation, it only indirectly communicates with the aRts soundserver, using knotify as DCOP -> MCOP bridge.

Due to that fact, if you need "fast" response times, more control or feedback, use the MCOP interfaces rather than this.

An example of using this class is:

       KAudioPlayer::play("/var/share/foo.wav");

If you want to use signals & slots, you can do something like:

       KAudioPlayer player("/var/share/foo.wav");
       connect(&button, SIGNAL(clicked()), &player, SLOT(play()));

KAudioPlayer ( const QString& filename, QObject* parent = 0, const char* name = 0 ) | ### KAudioPlayer

Constructor.

Parameters:

filename | Absolute path to the filename of the sound file to play
parent | A parent QObject for this KAudioPlayer
name | An internal name for this KAudioPlayer

~KAudioPlayer () | ### ~KAudioPlayer

Destructor.

void play (QString filename) | ### play

[static]

Static play function.

Parameters:

filename | Absolute path to the filename of the sound file to play. if not absolute, goes off KDEDIR/share/sounds/ (preferred)

void play () | ### play

[slot]

Play function as slot.

Plays the soundfile given to the constructor.

Generated by: root@sparc.ports.openbsd.org on Wed May 2 09:34:58 2001, using kdoc 2.0a53.