473,320 Members | 1,719 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Wave File Header

Does anyone know how to get the information from a Wave
File Header in VB.NET (or VB6). I need to check the
sample rate for the correct value.

JamesT
Jul 21 '05 #1
2 3878
James:

You can break a WAV file down into 3 distinct chunks: Header, Format,

Data. Assuming the WAV is represented as a byte array, here's how that

breaks down:

HEADER Chunk:

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

Byte

0-3 "RIFF" (string, ASCII)

4-7 Total Length of WAV file (uint)

8-11 "WAVE" (string, ASCII)

FORMAT Chunk:

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

12-15 "fmt " (string, ASCII)

16-19 Length of FORMAT chunk (uint, always 0x10)

20-21 Always 0x01

22-23 Channel mode (0x01 Mono, 0x02 Stereo)

24-27 Sample rate (uint)

28-31 Bytes per second (uint)

32-33 Bytes per sample (1=8-bit Mono, 2=8-bit Stereo or 16-bit Mono,

4=16-bit Stereo

34-35 Bits per sample

DATA chunk:

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

36-39 "data" (string, ASCII)

40-43 Length of DATA chunk (uint)

44-END Data (binary)

"JamesT" <ji*********@ampekko.com> wrote in message
news:06****************************@phx.gbl...
Does anyone know how to get the information from a Wave
File Header in VB.NET (or VB6). I need to check the
sample rate for the correct value.

JamesT

Jul 21 '05 #2
Be careful though. There is no requirement that no other chunks can exist,
this is just the most standard format. You should read each chunk header(ID
and length) and determine if its the chunk you need, if not skip down to the
next one.

"William Ryan" <do********@comcast.nospam.net> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl...
James:

You can break a WAV file down into 3 distinct chunks: Header, Format,

Data. Assuming the WAV is represented as a byte array, here's how that

breaks down:

HEADER Chunk:

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

Byte

0-3 "RIFF" (string, ASCII)

4-7 Total Length of WAV file (uint)

8-11 "WAVE" (string, ASCII)

FORMAT Chunk:

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

12-15 "fmt " (string, ASCII)

16-19 Length of FORMAT chunk (uint, always 0x10)

20-21 Always 0x01

22-23 Channel mode (0x01 Mono, 0x02 Stereo)

24-27 Sample rate (uint)

28-31 Bytes per second (uint)

32-33 Bytes per sample (1=8-bit Mono, 2=8-bit Stereo or 16-bit Mono,

4=16-bit Stereo

34-35 Bits per sample

DATA chunk:

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

36-39 "data" (string, ASCII)

40-43 Length of DATA chunk (uint)

44-END Data (binary)

"JamesT" <ji*********@ampekko.com> wrote in message
news:06****************************@phx.gbl...
Does anyone know how to get the information from a Wave
File Header in VB.NET (or VB6). I need to check the
sample rate for the correct value.

JamesT


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: david.kettle | last post by:
Hello Python World! I've been playing with the 'wave' and 'audioop' modules in the library, and I have a question. When I tried to read a "wav" file with samples in 32-bit float, I got the...
1
by: Jakub Dudek | last post by:
Hi, I am trying to read wave date (the 16 bits audio words) from a wave file using c++. I have tried using the mmsystems library. I got to the point where I read the wave data chunk into a...
4
by: vikram | last post by:
in a stereo type of wave file i want to know what is this left & right info in a wave file??? how do i read the left & right info from a .wav file to a buffer..
1
by: Don Tucker | last post by:
Hello, I am receiving the following compile-time error: /opt/include/rw/dcomplex.h line 218 error(1420): argument list for class template "complex" is missing typedef complex DComplex when...
2
by: JamesT | last post by:
Does anyone know how to get the information from a Wave File Header in VB.NET (or VB6). I need to check the sample rate for the correct value. JamesT
5
by: m.topczewski | last post by:
Hello, I'm a beginner in c++, i have to write a program that will take couple of segments from one wave file, and store them in another wave file to be played back later. Here's the code i have...
3
by: rajasekar.karthik | last post by:
Hi Guys I need a php script which will merge two wave files as i have already done a script which will will join the two wave files and play one after the other, can anyone advice me...
1
by: homevista | last post by:
Part II: Wave file - How to read to a buffer Wave (or Wav) is the standard format for storing audio data on the PC. As software developers, we are interested in the internal structure of the file...
6
by: homevista | last post by:
PART III: Putting things together In part I we examined the modem to verify that it supported voice. If so, we took a note about the voice data format that we would use. In the second part, we...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.