Wav file reading c code
I was really surprised, so I tried to 'fix' the proposed solution to get the best output I could. This class holds the results of my research. Here on The Code Project, one can find different. WAV files loading and playback solutions, using only Platform SDK and not using DirectX, so please take a look at them too before turning to this class only. Some solutions also provide. WAV files recording So, as you can see, parsing of this file type should not be too difficult.
This is called the RIFF structure, built from different 'chunks'. WAV sound data can be 8-bit or bit, mono or stereo, can have a different sampling rate, can be compressed or not, etc. We use this information to initialize the sound input or the sound output devices on the host PC. The next 'chunk', called the DATA 'chunk' holds the sound data, please see below:. So, actually we work with this sound data which represents the samples of the original audio signal, sampled at some high frequency, typically 11kHz, 22kHz, 44kHz.
The data samples can be 8-bit, bit, bit, bit. The different audio decompressors take care of the compressed sound data, and the different sound output devices can 'play' this data. The main goal here was to 'make a mixture' of the 2 different. WAV files. Edit Preview. H1 H2. Post Reply. Broken Link. Go Back to the Post Continue Anyways. Share Post. Permanent Link. Insert Code Block. Always check downloads with anti-virus and anti-spyware tools, you can never be entirely sure what happens to files in transit!!
Target platform: Windows XP, Windows 7 or later, 32 bit or 64 bit. The 32 bit version should run OK on 64 bit Windows. The 64 bit version will only run on 64 bit Windows. The waveform of the loaded file will be displayed in the middle pane, with a graph for each channel, and information about the file format in the top panel. If there is Broadcast Wave Format BWF data in the original file, then the originator, origin date, origin time and description will also be shown.
Files containing up to 8 channels may be opened. C code is not generated from the sound file that is read in, but from a mono or stereo mix generated from the original file. This enables you to generate a representative mono mix for an embedded system from a stereo source file, or generate outputs with varying selections from the channels in the original file.
The bottom panel contains several fader controls. There will be one fader enabled for each channel in the original WAV file. A spin control at the top selects which channel is input to the mix, and a spin control at the bottom of the fader selects which channel is the output. Thus if the top spin controls are set to 0, 1, and the bottom spin controls are set to 0, 0, then channel 0 of the mix will be taken from channels 0 and 1 of the original file, in proportion according to the slider setting.
To the right of the faders is a spinner to select the number of channels in the mix output - either 1 mono or 2 stereo are available. The resolution of the mix may be selected by the dropdown control labelled "No. The "MIX" button in the bottom panel will generate the output mix waveform. The dropdown control labelled "Autoscale options" has the settings "None", "Auto-limit", and "Normalise", which should be selected before clicking the Mix button.
0コメント