Home | Products | Testimonials | Prices | Support | Contact | Publications | About | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Quick Links
Home
Purchase
Support
Products Product Home ActiveX/COM Components .NET Components Version History Support Support Home Installation Help About Us Company Info Clients Testimonials Publications Contact Us |
DataIO/X ActiveX Control implements a number of methods that can be used for reading and writing audio WAV files. This gives application developers the ability to develop software for various purposes such as analyzing speech data. In particular, the control provides methods for:
With just a few lines of code, it is now possible to read in audio data for
further manipulation by your own application. Conversely, DataIO/X provides a
simple means of creating WAV audio files from your data samples. These data
samples could be obtained from any source, even other recordings or data
sources.
|
Sample Visual Basic 6 application created using DataIO/X. |
If you do have any questions or concerns about using our controls - all you need to do is email us and we will assist you in learning how to use our controls. Just take a look at our testimonials page to see some of the comments we have received from happy customers. we receive many emails from people who have questions about our products or who need a little assistance to get started using an ActiveX control in their program - don't hesitate to contact us and we will be pleased to help you.
Do you require some function that we don't already have? Contact us and we may be able to extend our controls to do what you require.
In the next section, we provide more technical information on the binary file format used for WAV audio files.
Digital audio information consists of sampled data. This means that raw sound waves which vary continuously in time and in magnitude of intensity, are sampled at regular intervals of time, for example, 44100 samples per second is one standard used for audio data. This information is generally sampled with a number of bits of resolution using an analog to digital converter and then stored in a computer file.
To process digital audio information, it is necessary to use a defined standard file format in which to store the data. While it would be feasible to use a text file to do this, there are many reasons why text files are not generally used for this purpose. Primarily, these reasons are concerned with speed and efficiency of the data storage. Text files, while mostly using the ASCII standard, are in a sense, not well defined. There can be different languages used, different end of line characters used, line feeds in some cases and not others limits used in the length of lines and overall of this, require computationally expensive parsing in order to extract information from the file.
Binary files on the other hand, while not in a convenient human readable form, ensure that data can be stored and retrieved in a very precise manner. Information can be stored and retrieved without having ambiguities of text files or the complex processing of string handling. Moreover, since the data is stored in a precise byte-wise arrangement, it is possible to read and write information in a manner not unlike random access memory (RAM).
The binary file format requires that each sampled data point uses a fixed number of bytes. The number of bytes determines the magnitude resolution. For example if we choose an 8-bit or 1-byte storage resolution, this means that there are 255 possible levels of the signal data. If we use a 16 bit audio format, then 2 bytes per sample per channel are used with a given resolution of 32768 levels. Higher quality sound definition requires that a sufficiently high sample rate is used and a sufficient number of bits are used. However the area of sound quality is complex and we will not discuss this issue here.
There are binary many audio file standards and in the next section, we discuss the WAV standard, which is handled by DataIO/X.
WAV Binary File
The WAV audio standard actually has many variations. Not all of these are in widespread use, and DataIO/X is not designed to be able to process all of them. The WAV audio standard that is able to be processed by DataIO/X is defined in the table below. This WAV file format is sometimes called the Canonical WAV or WAVE file format.
Offset | Field Name | Field Size | Description |
---|---|---|---|
0 |
ChunkID |
4 |
Contains the letters RIFF in ASCII form. |
4 |
ChunkSize |
4 |
Size of the entire file in bytes less 8 bytes for the first part of the header. Be warned however, that this file size may not accurate since not all vendors appear to set the file sizes correctly. |
8 |
Format |
4 |
Contains the letters WAVE in ASCII. |
12 |
SubChunk1ID |
44 |
Contains the letters "fmt " (ie fmt followed by a space.) |
16 |
SubChunk1Size |
|
PCM = 16. The size of the subchunk that follows this number. |
20 |
AudioFormat |
2 |
For PCM, this value = 1. PCM for linear quantization is used by simple Windows WAV audio files and is currently the only format handled by DataIO/X. |
22 |
NumChannels |
2 |
Number of channels. 2 channels indicates stereo. |
24 |
SampleRate |
4 |
Typical values are 44100, 11025 etc. |
28 |
ByteRate |
4 |
Number of bytes per second that are used for all data. This value equals SampleRate x NumChannels * BitsPerSample/8. |
32 |
BlockAlign |
2 |
Also known as BytesPerSample and equals NumChannels * BitsPerSample/8. |
34 |
BitsPerSample |
2 |
Typical values are 8, 16 |
36 |
SubChunk2ID |
4 |
Contains the letters "data" |
40 |
SubChunk2Size |
4 |
This equals NumSamples x NumChannels * BitsPerSample/8 |
44 |
Data |
SubChunk2Size |
This is where the actual sound data begins. If the BitsPerSample is 8 and there is only 1 channel, then each byte following is one sample or data point. However if there16 bits per channel, then each 2 byte set is one data point and so on. Multiple channels are handlded in turn. Thus for 2 channels of data, we have Ch1, Ch2, Ch1, Ch2, Ch1, Ch2 etc for the sequence of data points. |
There are numerous variations on this theme, and the DataIO/X component provides some methods which enables the user to determine if the binary file is valid in terms of the above format. It is possible that the file may be a WAV format which uses a different format and in this case, DataIO/X will still report the format as being invalid, that is not able to be processed by DataIO/X.
|