Sound Input
DarkNet includes a set of commands for gathering sound input from input devices e.g. microphone. Multiple input device can be used at the same time.
Input is un-paused using mnUnpauseInput and paused using mnPauseInput. While input is un-paused a stream of data will be received in the form of packets. This data is retrieved using mnGetInputData.
The sound format can be adjusted which changes the quality and size of data received. The format can be set to 3 preset quality levels using mnSetInputFormatLow, mnSetInputFormatMedium or mnSetInputFormatHigh. Alternatively precise format values can be specified using mnSetInputFormat; the following values can be set: Channels, Samples per second (hertz) and Bits per sample.
Visual Display
The below demo is a graphical application that represents sound input as a sound wave. The code is more complex than the other demos and for this reason it has not been converted to other languages, only a C++ version exists.
The demo also demonstrates two ways of manipulating sound volume using mnGetDataVolume and mnSetDataVolume:
1. Increase or decrease the volume by a set amount.
2. Fix the volume at a certain level i.e. if you shout the volume is decreased and if you whisper the volume is increased.
The application uses DarkGDK to generate the visual display.
Screenshot

Executable
Download
Code
C++
|