# MSRingPlayer

## Name

MSRingPlayer -- A nice source filter to play rings.

## Synopsis

    #include <msringplayer.h>

    struct      MSRingPlayer;
    MSFilter*   ms_ring_player_new              (char *name,
                                                 gint seconds);
    void        ms_ring_player_destroy          (MSRingPlayer *obj);

## Description

This filter plays a repeatly a sound followed by a period of silence. The sound is given as the path to a 16 bit raw audio file, and the interval is specified in number of seconds.

## Details

### struct MSRingPlayer

    struct MSRingPlayer {

        /* the MSRingPlayer derivates from MSFilter, so the MSFilter object MUST be the first of the MSRingPlayer object
           in order to the object mechanism to work*/
        MSFilter filter;
        MSFifo *foutputs[MS_RING_PLAYER_MAX_OUTPUTS];
        MSQueue *qoutputs[MS_RING_PLAYER_MAX_OUTPUTS];\
    	MSSync *sync;
        gint fd;  /* the file descriptor of the file being read*/
        gint space; /*space in samples between each ring */
        gint current_pos;
    	gint need_swap;
    };

### ms_ring_player_new ()

    MSFilter*   ms_ring_player_new              (char *name,
                                                 gint seconds);

Allocates a new MSRingPlayer object.

name : | The path to the 16-bit 8khz raw file to be played as a ring.
seconds : | The number of seconds that separates two rings.
Returns : | a pointer the the object, NULL if name could not be open.

### ms_ring_player_destroy ()

    void        ms_ring_player_destroy          (MSRingPlayer *obj);

Destroy a MSRingPlayer object.

obj : | A valid MSRingPlayer object.