2
The mediastreamer library aims at providing modular media processing and I/O
3
for linphone, but also for any telephony application.
4
Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Lesser General Public
8
License as published by the Free Software Foundation; either
9
version 2.1 of the License, or (at your option) any later version.
11
This library 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 GNU
14
Lesser General Public License for more details.
16
You should have received a copy of the GNU Lesser General Public
17
License along with this library; if not, write to the Free Software
18
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
#include "msringplayer.h"
24
#include "msosswrite.h"
25
#include "msossread.h"
31
#define READFILE "../share/rings/orig.wav"
32
#define WRITEFILE "/tmp/mediaout"
36
void stop_handler(int signum)
42
int main(int argc, char *argv[])
44
MSFilter *play,*copy,*rec;
56
play=ms_ring_player_new(ring,2);
57
//play=ms_oss_read_new(0);
58
rec=snd_card_create_write_filter(snd_card_manager_get_card(snd_card_manager,1));
61
ms_filter_get_property(play,MS_FILTER_PROPERTY_FREQ,&tmp);
62
g_message("Playing at rate %i.",tmp);
63
ms_filter_set_property(rec,MS_FILTER_PROPERTY_FREQ,&tmp);
64
ms_filter_get_property(play,MS_FILTER_PROPERTY_CHANNELS,&tmp);
65
g_message("Playing with %i channels",tmp);
66
ms_filter_set_property(rec,MS_FILTER_PROPERTY_CHANNELS,&tmp);
71
ms_filter_add_link(play,copy);
72
ms_filter_add_link(copy,rec);
73
ms_sync_attach(timer,play);
80
ms_sync_detach(timer,play);
82
ms_sync_destroy(timer);
84
ms_filter_remove_links(play,copy);
85
ms_filter_remove_links(copy,rec);
86
ms_filter_destroy(play);
87
ms_filter_destroy(copy);
88
ms_filter_destroy(rec);