Wav file manipulation.

I

iamnotnot

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/NET/Code/Media/Audio/WaveStream/article.asp

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 ± data ôþ Èÿ etc etc"

The format descriptin is here
http://ccrma.stanford.edu/CCRMA/Courses/422/projects/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 ="RIFF"
Dim chunksize As Int16 =4 + (8 + 16) + (8 + stream.Length)
Dim wave As Int16 ="WAVE"
'Dim riff As Int16 = "fmt "
'Dim riffsize As Int16 = 16
'Dim format As Integer = 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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top