Hi Senthil, To record mono using recfile sample application, you need to change the macro configuration in the recfile.c and rebuild it: ------------------------- /* Configs */ #define CLOCK_RATE 44100 #define NCHANNELS 2 #define SAMPLES_PER_FRAME (NCHANNELS * (CLOCK_RATE * 10 / 1000)) #define BITS_PER_SAMPLE 16 ------------------------- setting the NCHANNELS to 1 should do. Regards, Nanang On 08/04/2008, Senthil Raja <vsraja at yahoo.com> wrote: > > Thanks Daniel! > I guess my file is of type stereo. I downloaded a file from the web with > mono type and it worked fine. > I also tried your suggestion of setting channel as 2, it worked! but the > voice quality was very bad. > Now I have to see how I could record a a mono wav file. > > Regards, > Senthil. > > > ----- Original Message ---- > From: Daniel Mikusa <dan@xxxxxxxxxx> > To: pjsip list <pjsip at lists.pjsip.org> > Sent: Sunday, April 6, 2008 11:52:35 AM > Subject: Re: pjsip confsample does not work > > By default the sound files for that example need to be mono. Yours is > stereo. > Try using the -c option to set the number of channels to two. > > Dan > > *macbook-pro:samples daniel$ ./confsample-i386-apple-darwin9.2.0 -h* > * 14:49:44.601 os_core_unix.c pjlib 0.8.0-trunk for POSIX initialized* > * 14:49:44.602 confsample.c Error: unknown options 'h'* > * > * > * FILE:** ** * > * ** * > * confsample.c** ** * > * ** * > * PURPOSE:** ** * > * ** * > * Demonstrate how to use conference bridge.** ** * > * ** * > * USAGE:** ** * > * ** * > * confsample [options] [file1.wav] [file2.wav] ...** ** * > * ** * > * options:** ** * > * -d, --dev=NUM Sound device use device id NUM (default=-1)** ** * > * -r, --rate=HZ Set clock rate in samples per sec (default=44100)* > * -c, --channel=NUM Set # of channels (default=1 for mono).** ** * > * -f, --frame=NUM Set # of samples per frame (default equival 20ms)* > * -b, --bit=NUM Set # of bits per sample (default=16)** ** * > * ** * > * fileN.wav are optional WAV files to be connected to the conference > * > * bridge. The WAV files MUST have single channel (mono) and 16 bit PCM > * > * samples. It can have arbitrary sampling rate.** ** * > * ** * > * DESCRIPTION:** ** * > * ** * > * Here we create a conference bridge, with at least one port (port zero > * > * is always created for the sound device).** ** * > * ** * > * If WAV files are specified, the WAV file player ports will be > connected * > * to slot starting from number one in the bridge. The WAV files can have > * > * arbitrary sampling rate; the bridge will convert it to its clock rate. > * > * However, the files MUST have a single audio channel only (i.e. mono). > * > > > On Apr 6, 2008, at 4:28 AM, Senthil Raja wrote: > -- > This message has been scanned for viruses and > dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is > believed to be clean. > > > Hi, > I tried to execute "confsample" from the pjsip samples and got the > following error (see below). Could some one explain what this error means. > FYI, the ininput file "welcome.wav" was created using "recfile" sample. > > Thanks, > Senthil. > > ../pjproject-0.8.0/pjsip-apps/bin/samples/confsample-i686-pc-linux-gnu > welcome.wav > 16:42:21.441 os_core_unix.c pjlib 0.8.0 for POSIX initialized > 16:42:21.462 pasound.c PortAudio sound library initialized, status=0 > 16:42:21.469 pasound.c PortAudio host api count=1 > 16:42:21.485 pasound.c Sound device count=1 > 16:42:21.504 pjlib select() I/O Queue created (0x809121c) > 16:42:21.518 conference.c Creating conference bridge with 3 ports > 16:42:21.593 pasound.c Opened device /dev/dsp(OSS)//dev/dsp(OSS) for > recording and playback, sample rate=44100, ch=1, bits=16, 882 samples per > frame, input latency=23 ms, output latency=23 ms > 16:42:21.599 pasound.c Starting /dev/dsp stream.. > 16:42:21.688 pasound.c Recorder thread started > 16:42:21.691 os_core_unix.c Info: possibly re-registering existing thread > 16:42:21.699 pasound.c Player thread started > 16:42:21.706 pasound.c Done, status=0 > 16:42:21.708 conference.c Sound device successfully created for port 0 > 16:42:21.710 wav_writer.c File writer 'confrecord.wav' created: > samp.rate=44100, bufsize=4KB > 16:42:21.718 wav_player.c File player 'welcome.wav' created: > samp.rate=44100, ch=2, bufsize=4KB, filesize=1188KB > confsample-i686-pc-linux-gnu: ../src/pjmedia/conference.c:678: > pjmedia_conf_add_port: Assertion `!"Number of channels mismatch"' failed. > Aborted > > > ------------------------------ > You rock. That's why Blockbuster's offering you one month of Blockbuster > Total Access<http://us.rd.yahoo.com/evt=47523/*http://tc.deals.yahoo.com/tc/blockbuster/text5.com>, > No Cost. > -- > This message has been scanned for viruses and > dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is > believed to be clean. _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > > > > ------------------------------ > You rock. That's why Blockbuster's offering you one month of Blockbuster > Total Access<http://us.rd.yahoo.com/evt=47523/*http://tc.deals.yahoo.com/tc/blockbuster/text5.com>, > No Cost. > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip at lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20080408/09c81e1b/attachment-0001.html