| iamnotnot@gmail.com 2007-02-28, 7:09 pm |
| I have hour long wav files on my server.
I would like the user to be able to download arbitrary chunks of say 5
minutes length from any part of the whole.
I have located a stream reader that will read with an offset, and the
accompanying writer will save the correct 5 mins.
http://www.vbaccelerator.com/home/N...ream/article.a=
sp
However as far as I can see the writer will only save to the servers
filespace. I don't really want to save them to disk then push them to
the user. even if I delete them straight off there are bound to be
temp files filling up eventually.
My real problem is writing the header for the file.
the writer produces a file that looks like this "RIFF&
WAVEfmt D =B1 data =F4=FE =C8=FF etc etc"
The format descriptin is here
http://ccrma.stanford.edu/CCRMA/Cou...cts/WaveFormat/
I need to build this header up byte by byte but I am at a loss as to
how to go about this.
Dim ChunkID As Int16 =3D"RIFF"
Dim chunksize As Int16 =3D4 + (8 + 16) + (8 + stream.Length)
Dim wave As Int16 =3D"WAVE"
'Dim riff As Int16 =3D "fmt "
'Dim riffsize As Int16 =3D 16
'Dim format As Integer =3D 1
etc
however I just get buffer overflows trying to squish things into
int16's... I am not even sure if they are the right things.
If you got this far thank you very much! I guess my real question is
how to go about doing low level byte handling stuff... which I have
never had to do before!
|