[Home]

Summary:ASTERISK-01081: WAV49 file recorded can not be played
Reporter:Jim Gottlieb (tokyojimu)Labels:
Date Opened:2004-02-23 16:41:31.000-0600Date Closed:2008-01-15 14:44:41.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) recordtest.agi
( 1) tvation-1-10.WAV
Description:I use RECORD FILE to record a file in WAV49 format, and the file is created, but when I use STREAM FILE to play it back, it errors:
Feb 23 13:21:29 WARNING[650257]: format_wav_gsm.c:203 check_header: Does not say data
Feb 23 13:21:29 WARNING[650257]: file.c:379 ast_filehelper: Unable to open fd on tvation-1-10
Feb 23 13:21:29 WARNING[650257]: app_agi.c:332 handle_streamfile: Unable to open tvation-1-10

****** ADDITIONAL INFORMATION ******

Sample file attached
Comments:By: Brian West (bkw918) 2004-02-24 13:35:32.000-0600

Please verify it only happens with app_Agi and not app_record.

bkw

By: Jim Gottlieb (tokyojimu) 2004-02-24 17:22:21.000-0600

app_record has a bug that prevents me from testing this.  If I specify the extension as WAV, it records it as a wav instead.  To wit:

exten => 16193648353,1,Answer
exten => 16193648353,2,Record(wavtest:WAV|10)
exten => 16193648353,3,Hangup
;
exten => 16193648354,1,Answer
exten => 16193648354,2,Playback(wavtest)
exten => 16193648354,3,Hangup

$ ls /var/lib/asterisk/sounds/wavtest.*
/var/lib/asterisk/sounds/wavtest.wav

edited on: 02-24-04 16:09

By: Brian West (bkw918) 2004-02-24 20:57:36.000-0600

exten => 8989,1,Answer
exten => 8989,2,Record(/tmp/testing:wav49)
exten => 8989,3,Wait(1)
exten => 8989,4,Playback(/tmp/testing)
exten => 8989,5,Wait(5)
exten => 8989,6,Hangup

The documentation for app_record is a bit wrong on WAV (wav49)

Test that please it may be the same issue with AGI.

By: Jim Gottlieb (tokyojimu) 2004-02-24 21:11:38.000-0600

That works, so it seems to be a problem in app_agi.

By: Brian West (bkw918) 2004-02-24 22:00:26.000-0600

ok the problem in app_records is being commited where WAV will be also accepted as wav49 but I need to know how you are calling record file in your AGI.  Can you post the parts of that code.... I think it suffers the same problem.

By: Jim Gottlieb (tokyojimu) 2004-02-24 22:21:52.000-0600

Here's a small app (recordtest.agi).  It answers and waits for:
3 + prompt number + *   records a message
1 + prompt number + *   plays a message

where prompt number is between 1 and 10.

If I use "WAV" it records in standard wav format.  Yesterday I got the same result with "WAV" as I'm getting with wav49 (I think).

By: Brian West (bkw918) 2004-02-25 00:30:34.000-0600

ya app_agi suffers the same as app_record does.... WAV == wav and wav49 is WAV ya get it?  silly things.

By: Brian West (bkw918) 2004-02-25 00:32:33.000-0600

Hope to have a fix for both.

By: James Golovich (jamesgolovich) 2004-02-25 17:46:23.000-0600

Fixed in CVS.  Thanks for finding this one, it caused a few things to get fixed

By: Paul Cadach (pcadach) 2004-02-26 00:29:34.000-0600

Reminder sent to jamesgolovich

Your patch for format_wav_gsm.c is totally wrong. At least for skipping analyzing for "data" section name and looks like corrupted header. For me (on voicemail) all works fine.

Checked. Header corrupts by wav_seek when it deduces that first data is located at offset 52 rather than at offset 60 (also see markster's patch for CVS revision 1.14 - those bugs comes together).

By: Paul Cadach (pcadach) 2004-02-26 00:35:49.000-0600

Reminder sent to jamesgolovich

Confirmed. Changing 52 to 60 at wav_seek fixes this bug, and header goes right, file plays not only by Asterisk, but by Windows Media Player too (for unfixed recordings one says something about missing ClassFactory).

By: James Golovich (jamesgolovich) 2004-02-26 01:52:43.000-0600

I was just trying to get something that worked, since I couldn't get ast_writefile to create a valid file that could be played back by asterisk I did what I could to make it work.

I'm trying out the fix you suggest, and it looks good.  I'll commit the changes

By: Paul Cadach (pcadach) 2004-02-26 02:00:25.000-0600

As you can see at noted by reporter, there was message about missing "data" section header, so you should to figure out WHY this header is missing at the file while it was written out when file just created.

After rollback your comment and fixing wav_seek() this bug could be closed IMHO.

By: Digium Subversion (svnbot) 2008-01-15 14:44:37.000-0600

Repository: asterisk
Revision: 2247

U   trunk/apps/app_record.c
U   trunk/file.c
U   trunk/formats/format_g723.c
U   trunk/formats/format_wav_gsm.c
U   trunk/include/asterisk/file.h

------------------------------------------------------------------------
r2247 | citats | 2008-01-15 14:44:37 -0600 (Tue, 15 Jan 2008) | 5 lines

Bug ASTERISK-1081.  Fix wav49 format so it can be played.  Make file functions
looking for extension use f->exts instead of f->name.  Fix bug
where error message didn't print file extension. Fix comments in header file.
Everything is completely backwards compatible

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=2247

By: Digium Subversion (svnbot) 2008-01-15 14:44:38.000-0600

Repository: asterisk
Revision: 2248

U   branches/v1-0_stable/apps/app_record.c
U   branches/v1-0_stable/file.c
U   branches/v1-0_stable/formats/format_g723.c
U   branches/v1-0_stable/formats/format_wav_gsm.c
U   branches/v1-0_stable/include/asterisk/file.h

------------------------------------------------------------------------
r2248 | citats | 2008-01-15 14:44:38 -0600 (Tue, 15 Jan 2008) | 5 lines

Bug ASTERISK-1081.  Fix wav49 format so it can be played.  Make file functions
looking for extension use f->exts instead of f->name.  Fix bug
where error message didn't print file extension. Fix comments in header file.
Everything is completely backwards compatible

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=2248

By: Digium Subversion (svnbot) 2008-01-15 14:44:41.000-0600

Repository: asterisk
Revision: 2252

U   branches/v1-0_stable/formats/format_wav_gsm.c

------------------------------------------------------------------------
r2252 | citats | 2008-01-15 14:44:41 -0600 (Tue, 15 Jan 2008) | 2 lines

Really fix format_wav_gsm.c.  Thanks PCadach! (bug ASTERISK-1081)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=2252

By: Digium Subversion (svnbot) 2008-01-15 14:44:41.000-0600

Repository: asterisk
Revision: 2251

U   trunk/formats/format_wav_gsm.c

------------------------------------------------------------------------
r2251 | citats | 2008-01-15 14:44:40 -0600 (Tue, 15 Jan 2008) | 2 lines

Really fix format_wav_gsm.c.  Thanks PCadach! (bug ASTERISK-1081)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=2251