Hi, On 01/09/2008, Fr??d??ric CLEMENT <fclement at viatelecom.com> wrote: > Hi all, > > I get a strange problem playing files with pjsua_player_create. > When I try to play the example wav file given with the psip library, all is > working very well. > > I tried with a file of mines and I get the following message : > > 10:58:48.027 pjsua_media.c Unable to open file for playback: Not a valid > WAVE file (PJMEDIA_ENOTVALIDWAVE) [status=220180] > FCVOC: ../src/pjsua-lib/pjsua_media.c:1784: > pjsua_player_get_port: Assertion > `id>=0&&id<(int)(sizeof(pjsua_var.player)/sizeof(pjsua_var.player[0]))' > failed. > Abandon > > > What I understood is that the format of my file is wrong. > With sox, I get following : > > The working file : > > Input Filename : ../sound.wav > Sample Size : 16-bits > Sample Encoding: signed (2's complement) > Channels : 1 > Sample Rate : 8000 > > The non-working file : > > Input Filename : Acc2.wav > Sample Size : 16-bits > Sample Encoding: signed (2's complement) > Channels : 1 > Sample Rate : 8000 > > > It seems to me that the formats are the same. > So why is one working and the other not ? There are few more attributes checked by wav_player, like: tags, file size. So PJMEDIA_ENOTVALIDWAVE may be produced by any of those checks. If it is possible, please try to debug stepping into pjmedia_wav_player_port_create(). > > > By the way, how can I avoid the program to stop on this kind of error ? Pjsua application (pjsua_app.c) does stop if it failed to open wav file, regardless of whether there is assertion or not, so I am afraid the solution would be modifying the behavior of pjsua_app.c as you want, e.g: ignoring pjsua_player_create() error. > I tried to compile with NDEBUG flag, but it still stops on "Assertion". In release mode, normally assertion should not be occured, please try to clean up before rebuild. Regards, nanang