Samples
This demo shows how to record audio, create .wav-files, playback them and visualize audio stream.
It demonstrates how to use WaveRiff
, WaveIn
,
WaveOut
and DisplayBands
components.
We are using two chains of components:
1. WaveIn => WaveRiff (recording); WaveIn => DisplayBand(s)
2. WaveRiff => WaveOut (playback); WaveRiff => DisplayBand(s)
RECORDING:
Please follow these steps:
1. Place WaveIn & WaveRiff components on form.
2. Set WaveRiff.IsInput = False;
The last property change means we're going to record .wav instead of playback.
3. Set link between WaveIn (provider) and WaveRiff (consumer). Set link between WaveIn and DisplayBands. Refer to Providers & Consumers section for details.
4. Set WaveRiff.FileName property that is used to create .wav-file on disk.
5. To start recording activate WaveIn (WaveIn.Active = True) that automatically activates WaveRiff.
6. When you want to stop recording close WaveIn (WaveIn.Active = False).
This closes WaveRiff component and creates the .wav-file.
PLAYBACK:
Please follow these steps:
1. Place WaveRiff & WaveOut components on form.
2. Set WaveRiff.IsFormatProvider = True; WaveRiff.RealTime = True.
3. Set link between WaveRiff (provider) and WaveOut (consumer). Set link between WaveRiff and DisplayBands. Refer to Providers & Consumers section for details.
4. Set WaveRiff.FileName property to .wav-file you wish to play.
5. To start playback activate WaveRiff (WaveRiff.Active = True) that automatically activates WaveOut.
6. When you want to stop playback close WaveRiff (WaveRiff.Active = False).