1
/* $Id: wav_playlist.h 3553 2011-05-05 06:14:19Z nanang $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#ifndef __PJMEDIA_WAV_PLAYLIST_H__
21
#define __PJMEDIA_WAV_PLAYLIST_H__
24
* @file wav_playlist.h
25
* @brief WAV file playlist.
27
#include <pjmedia/wav_port.h>
35
* @defgroup PJMEDIA_WAV_PLAYLIST WAV File Play List
36
* @ingroup PJMEDIA_PORT
37
* @brief Audio playback of multiple WAV files
40
* The WAV play list port enables application to play back multiple
41
* WAV files in a playlist.
45
* Create a WAV playlist from the array of WAV file names. The WAV
46
* files must have the same clock rate, number of channels, and bits
47
* per sample, or otherwise this function will return error.
49
* @param pool Pool to create memory buffers for this port.
50
* @param port_label Optional label to set as the port name.
51
* @param file_list Array of WAV file names.
52
* @param file_count Number of files in the array.
53
* @param ptime The duration (in miliseconds) of each frame read
54
* from this port. If the value is zero, the default
55
* duration (20ms) will be used.
56
* @param options Optional options. Application may specify
57
* PJMEDIA_FILE_NO_LOOP to prevent play back loop.
58
* @param buff_size Buffer size to be allocated. If the value is zero or
59
* negative, the port will use default buffer size (which
61
* @param p_port Pointer to receive the file port instance.
63
* @return PJ_SUCCESS on success, or the appropriate error code.
65
PJ_DECL(pj_status_t) pjmedia_wav_playlist_create(pj_pool_t *pool,
66
const pj_str_t *port_label,
67
const pj_str_t file_list[],
72
pjmedia_port **p_port);
76
* Register a callback to be called when the file reading has reached the
77
* end of file of the last file. If the file is set to play repeatedly,
78
* then the callback will be called multiple times. Note that only one
79
* callback can be registered for each file port.
81
* @param port The WAV play list port.
82
* @param user_data User data to be specified in the callback
83
* @param cb Callback to be called. If the callback returns non-
84
* PJ_SUCCESS, the playback will stop. Note that if
85
* application destroys the file port in the callback,
86
* it must return non-PJ_SUCCESS here.
88
* @return PJ_SUCCESS on success.
91
pjmedia_wav_playlist_set_eof_cb(pjmedia_port *port,
93
pj_status_t (*cb)(pjmedia_port *port,
105
#endif /* __PJMEDIA_WAV_PLAYLIST_H__ */