Commit b448d5a9 authored by Simon Morlat's avatar Simon Morlat
Browse files

allow setting of output audio format in LinphoneSoundDaemon

parent 6cc2bfad
......@@ -41,7 +41,7 @@ bool_t lsd_player_loop_enabled(const LsdPlayer *p);
void lsd_player_set_gain(LsdPlayer *p, float gain);
LinphoneSoundDaemon *lsd_player_get_daemon(const LsdPlayer *p);
LinphoneSoundDaemon * linphone_sound_daemon_new(const char *cardname);
LinphoneSoundDaemon * linphone_sound_daemon_new(const char *cardname, int rate, int nchannels);
LsdPlayer * linphone_sound_daemon_get_player(LinphoneSoundDaemon *lsd);
void linphone_sound_daemon_release_player(LinphoneSoundDaemon *lsd, LsdPlayer *lsdplayer);
void linphone_core_use_sound_daemon(LinphoneCore *lc, LinphoneSoundDaemon *lsd);
......
......@@ -219,7 +219,7 @@ void lsd_player_set_gain(LsdPlayer *p, float gain){
ms_filter_call_method(p->lsd->mixer,MS_AUDIO_MIXER_SET_INPUT_GAIN,&gainctl);
}
LinphoneSoundDaemon * linphone_sound_daemon_new(const char *cardname){
LinphoneSoundDaemon * linphone_sound_daemon_new(const char *cardname, int rate, int nchannels){
int i;
MSConnectionPoint mp;
LinphoneSoundDaemon *lsd;
......@@ -238,8 +238,8 @@ LinphoneSoundDaemon * linphone_sound_daemon_new(const char *cardname){
lsd=ms_new0(LinphoneSoundDaemon,1);
lsd->soundout=ms_snd_card_create_writer(card);
lsd->mixer=ms_filter_new(MS_AUDIO_MIXER_ID);
lsd->out_rate=44100;
lsd->out_nchans=2;
lsd->out_rate=rate;
lsd->out_nchans=nchannels;
ms_filter_call_method(lsd->soundout,MS_FILTER_SET_SAMPLE_RATE,&lsd->out_rate);
ms_filter_call_method(lsd->soundout,MS_FILTER_SET_NCHANNELS,&lsd->out_nchans);
ms_filter_call_method(lsd->mixer,MS_FILTER_SET_SAMPLE_RATE,&lsd->out_rate);
......
......@@ -51,7 +51,7 @@ int main(int argc, char *argv[]){
linphone_core_enable_logs(stdout);
lc=linphone_core_new(&vtable,NULL,NULL,NULL);
lsd=linphone_sound_daemon_new (NULL);
lsd=linphone_sound_daemon_new (NULL,44100,1);
linphone_core_use_sound_daemon(lc,lsd);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment