I'm reordering the code in ao_wav.c that writes wav files to prevent the problem we had earlier. If ogg123 was improperly terminated (Segfault, kill -9, etc.), the output wav file was not even recognizable because the header was totally blank. I have found that at the start of playback (from libao's perspective), I know all of the wav header info except two things: 1) The length of the RIFF chunk. (filesize - 8, in our case) 2) The length of the data chunk. (filesize - 44, in our case) Assuming I have no idea how long the file is going to be, what are sane values to put in for these lengths ahead of time? I find if I put 0, the sox frontend "play" will just play nothing (it actually pays attention to the value). Basically, wav files don't seem like they should be streamable anyway, so you shouldn't use them for that purpose. However, since I have to pick something to put in those blanks, I want something that will be useful in the most cases. [The long term solution is to create a raw device that just dumps the data so you can massage it into whatever format you like.] Oh yeah, Ken, commit the buffer_shutdown patch in CVS so wav writing works again, please!! --- Stan Seibert --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
> I have found that at the start of playback (from libao's perspective), Iknow> all of the wav header info except two things: > > 1) The length of the RIFF chunk. (filesize - 8, in our case) > 2) The length of the data chunk. (filesize - 44, in our case) > > Assuming I have no idea how long the file is going to be, what are sanevalues> to put in for these lengths ahead of time? I find if I put 0, the sox > frontend "play" will just play nothing (it actually pays attention to the > value).Just a thought, maybe it just checks for a valid header ? The filesize in riff should be at least enough for the header.. Then subtract 36 (44-8 :) and put that value in datachunk.. Let me know if it works :) Gerry --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
On Sun, Jan 14, 2001 at 09:52:54AM -0700, volsung@asu.edu wrote:> I'm reordering the code in ao_wav.c that writes wav files to prevent the > problem we had earlier. If ogg123 was improperly terminated (Segfault, > kill -9, etc.), the output wav file was not even recognizable because the > header was totally blank. > > I have found that at the start of playback (from libao's perspective), I know > all of the wav header info except two things: > > 1) The length of the RIFF chunk. (filesize - 8, in our case) > 2) The length of the data chunk. (filesize - 44, in our case)You can find the PCM length of the Vorbis file iff* the input is seekable. *(if and only if)> Assuming I have no idea how long the file is going to be, what are sane values > to put in for these lengths ahead of time? I find if I put 0, the sox > frontend "play" will just play nothing (it actually pays attention to the > value).If you know the finished PCM size, write it in. If you don't, you can make it 'infinite' length; this will break, AFAIK, only XMMS among the apps I use. Then go back and fill it in at the end. If the output isn't seekable and you don't know the output length when you start, proper behavior is to warn the user (much as sox does).> > Basically, wav files don't seem like they should be streamable anyway, so you > shouldn't use them for that purpose. However, since I have to pick something > to put in those blanks, I want something that will be useful in the most > cases.Right. Monty --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
On Sun, Jan 14, 2001 at 09:52:54AM -0700, volsung@asu.edu wrote: [...]> Oh yeah, Ken, commit the buffer_shutdown patch in CVS so wav writing works > again, please!!*smacks self* Got it. And a fix to buffer.c to make it work compiled with optimizations. Sorry, mentally incognito for a few days. -- Kenneth Arnold <ken@arnoldnet.net> / kcarnold / Linux user #180115 http://arnoldnet.net/~kcarnold/ <HR NOSHADE> <UL> <LI>application/pgp-signature attachment: stored </UL> -------------- next part -------------- A non-text attachment was scrubbed... Name: part Type: application/octet-stream Size: 233 bytes Desc: not available Url : http://lists.xiph.org/pipermail/vorbis-dev/attachments/20010114/765210f8/part-0001.obj