Results 1 to 2 of 2

Thread: How to play multiple wav file ?

  1. #1
    aliarjmandi Guest

    Default How to play multiple wav file ?

    I use PIKAGrandPrix1.3 and Pika Analog board to make simple call center .
    I want play multiple wav file .
    I need sample about
    IN TPikaHandle channelHandle,
    IN PKX_TAudioData * data,
    IN PK_U32 flags

  2. #2
    pedmunds Guest

    Default Using PKX_CHANNEL_PlayAddData to play multiple WAV files

    With the High-Level API, GrandPrix, there are two methods to play audio on a channel.

    (method 1) A single file can be played to a channel by calling PKX_CHANNEL_PlayFile( ).

    (method 2) Any number of audio data blocks (either a memory buffer or an audio file) can be added to a queue using PKX_CHANNEL_PlayAddData( ), and then played using PKX_CHANNEL_Play( ).

    To use method (2) to play multiple WAV files, call PKX_CHANNEL_PlayAddData once for each file. Once you have added all files to the queue, call PKX_CHANNEL_Play to play the contents of the queue to the specified channel.

    Here is a general example using method 2:

    // 1. create the audioData structure for the data block to be added to the queue
    PKX_TAudioData audioData;
    memset(&audioData, 0, sizeof(PKX_TAudioData));
    audioData.location.filename = <filename>
    audioData.length = <length of audio data, in bytes>
    audioData.typeFlags = PKX_AUDIO_DATA_TYPE_FILE

    // 2. add the file to the queue
    PK_STATUS status;
    status = PKX_CHANNEL_PlayAddData(channelHandle, &audioData, PKX_AUDIO_WAVE_HEADER | PKX_AUDIO_SAMPLING_RATE_8KHZ);

    // 3. repeat steps 1 and 2 above for each file

    // 4. create the terminating conditions (none in this case) for the Play command
    PKX_TTermCond termCond;
    memset(&termCond, 0, sizeof(PKX_TTermCond));

    // 5. Start playing the queued buffer
    status = PKX_CHANNEL_Play(channelHandle, &termCond);
    Last edited by pedmunds; 09-15-08 at 02:08 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts