|
VC components. Samples |
News |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Demo package includes a set of rich-featured sample applications which show the power of the product. This package can be freely downloaded and includes binary files as well as actual sources of samples for a reference. Sample appliactions do not require much to be running: Microsoft Windows 98 or later, TCP/IP stack and one or more sound card. To install the package simply follow the instruction of setup program. To remove it, use uninstall program located in Start Menu group for VC 2.5 Demos (or the root folder of installation directory). Alternatively select VC 2.5 Demos from Settings \ Control Panel \ Add Remove Programs.
Simple console samplesBasic tasks, such as audio recording, playback, mixing, stream encoding and decoding are easy to do with VC components. These tasks are demonstrated in a set of simple samples. Every sample performs exactly one task. You can skip this section if you are interested in more advanced examples. We will start with deviceEnum application. It lists all audio devices installed on a system. To save the output, redirect it to a file:
Then open
The Similar acmEnum application enumerates audio codecs installed on a system. It uses Microsoft Multimedia Audio API and Audio Compression Manager (ACM) routines to perform the enumeration.
recorder and player demos show how to record and playback audio streams with different sampling parameters.
Review configuration parameters of these demos by editing the
Audio streams encoding and decoding is also one of the basic task, which is usually performed with VC components.
The codec application uses
Some applications require several audio streams to be mixed together to be played back at the same time.
While many sound card drivers allow several wave streams to be played back at the same time (so they will be mixed by hardware),
sometimes it is more advisable to mix audio inside your application, and that is what our mixer application does.
By default it mixes two input PCM files--
The volLevel demo is a simple wave volume meter application,
which demonstrates the usage of volume detection mechanism,
supported by As you may have noticed, all these demos do not use VCL, so resulting executable files are very compact in size. If you are not going to use GUI and VCL in your applications, VC components still can be used efficiently. Format convertersWav2mp3, Wav2ogg and Ogg2wav demos use one of the external encoder/decoder to convert WAV into MP3 or Ogg files and Ogg files back to WAV. Currently supported are Blade and Lame MP3 encoders and Ogg/Vorbis encoder and decoder. You need the encoder library files (one or more DLLs) for this demos to work properly. Original WAV file does not has to have required sampling rate, bits or channels number. It even does not has to be in PCM format. All necessary conversion will be done by RIFF reader and PCM resampler used in our demos. The vcMp3Demo demo uses same classes to create or read real-time MP3 or Ogg/Vorbis streams. Wave Player
Wave Player is a basic WAVe file playback sample with position, volume and tempo control, auto rewind feature and graphics display of audio data. Sampler
A more advanced example, Sampler includes the following features: real-time recording and playback, mixing, resampling, WAVe files reading and writing. It is possible to select any of the supported PCM formats for playback and recording. When playback device is active, you can add several wave channels to be mixed together. The source of audio could be any WAVe file stored on your disks. Every source wave can be resampled at different frequency, which leads to change in tempo it is played back by device. You can also change the volume and pan the wave between channels.
In the Pulse Gen
The Pulse Gen sample shows how to generate a sine audio waves, mix and playback them in real time and optionally save the result into a WAVe file. Loopback
It is possible to fine-tune internal chunk size used by all VC components to achieve smaller latency or better CPU performance according to special needs. Loopback demo shows how to change the chunk size programmatically, and displays codec compression ratio as well as current recording/playback latency. To calculate the latency this demo compares actual number of samples being recorded and played back. Some audio drivers or sound cards may return incorrect values, so correct calculation is not always possible. Voice Recording
Silence detection feature is important to save the network traffic when recording and sending a human voice. Try to record your voice with Voice Recording sample. Change the vertical slider to adjust minimum volume level you wish to record. When playing back notice that silence gaps were not included in final recording. This demo also shows how to create non-PCM (compressed) WAVe files to save the disk space. Refer to Voice Chat sample which shows how to send compressed voice over network, and use silence detection to save the traffic. DAF
Sometimes it may be needed to control the audio chunks manually to achieve some special functionalty. For example, in DAF sample we pass audio chunks from recording device to playback device. Although it may be done by simply linking waveIn with waveOut component, we need to ensure very short delay, of about 20 ms. Due to buffering, it only possible if we take control of the process and pass audio chunks to playback device as soon as they arrive from recording device.
Main job is done by the Frequency Bands
The simple Frequency Bands sample shows different kinds of frequency bands displays, all connected to one audio source.
It uses EQ and Splitter
This demo shows how to use equalizer and frequency splitter from DSP library. Noise detector
Displays how different configuration parameters affect the level and noise detectors from DSP Library. Tape Recorder
Audio data may be stored in memory before it is saved in a file. That allows end-user to master the recording, making small corrections, overwriting or inserting new recording data. The most common application of the Tape Recorder sample is a digital voice recording. Mixer Demo
Despite the name, Mixer Demo does not mix audio streams.
It simply shows how to use classes from the Voice Chat
Voice Chat is the voice chat sample where TCP/IP network streaming components are used to send and receive audio and text. It includes server and client parts. Server part should be running on one machine while client part on another. Streaming is done in both directions using one connection. No configuration is required for the server. Client must know the IP address (or DNS name) of server machine. This demo uses GSM codec to save the network traffic, and you can choose the sampling rate. This demo can also use silence detection mechanism to reduce the network traffic. In addition to voice, you can exchange with short text messages. For more advanced audio streaming application, refer to Talk Now or Net Talk demos. Push BMP
In addition to audio and text, you can exchange any custom data with remote side. Our Push BMP demo creates audio conversation channel, after that it is possible to use it to send a picture from one side to another. There is no need to create a new connection for custom data exchange. NOTE: Although VC will care about re-packing big data blocks into smaller ones, avoid sending more than 16 KB at a time. Create a loop and send smaller chunks one by one instead. Collect these chunks on remote side (VC will ensure proper order of packets even for UDP). Be also sure not to overload the bandwidth (in this case, for UDP some data will be lost, for TCP there will be some delays and gaps in real-time audio streaming). Talk Now
Talk Now is a more advanced audio streaming application. It includes server and client parts. You start server part on one machine and client on another. Streaming is done in both directions using one connection. Specify port number and socket type for server. Client must specify the IP address (or DNS name) of server machine and streaming port number, as well as socket type (TCP or UDP). It is also possible select any installed codec to be used for audio compressing with this demo. For long-latency networks, such as satellite connection, it is recommended to use UDP sockets. This demo can also large pre-buffers to avoid audio loss in such networks. This options can be turned on and off in Options menu. In addition, vaTalkNow Server can handle more than one Client connection, enabling conference-like audio streaming. Maximum number of clients may be specified in Options menu. Source of audio distributed among Clients is live recording done on Server side. For demonstration of how to distribute remote audio source, lease refer to Distribution Server and Client demo. Another advanced audio streaming application is Net Talk demo. Net Talk
Real time audio streaming requires some advanced techniques to be used, such as audio compression, real time streaming protocol and others. Net Talk demo combines all of this features and demonstrates the power of VC components. Both server and client can use any installed ACM codec to compress the stream. Both can mix real time recording with WAVe file stored on your disk. You can disconnect and connect the client at any time, without restarting the server. If you stop the server, the client must be reconnected. As with Talk Now demo, there are server and client parts in the same application, and only one part should be active at a time on one machine. Both UDP (datagram) and TCP (streaming) sockets can be used for connection. Server and client can use different ACM audio codecs, but make sure the codec selected on one side is installed on remote side. RAW Streamer
Sometimes audio data must be sent over network as it is, without additional headers and protocol. This demo shows how to setup client and/or server for raw streaming mode. Audio Tunnel
Audio Tunnel sample was designed to allow TCP/IP clients and servers located behind proxy/firewall to communicate with outer world by maintaining an virtual "audio tunnel" connection. This application should be running on a router machine, which has access to both Internet and local network. It should also be configured to listen for incoming request from local or remote client, and to redirect this request to local or remote server. One instance of this application can support one peer-to-peer connection: CLIENT <--> Audio Tunnel <--> SERVER Broadcast
Broadcasting is a feature, supported in LAN (Local Area Networks) only. Broadcast server does not know about how many clients will listen for distributed audio stream. Clients usually do not send any data back to server, so it is very similar to usual radio broadcasting. Broadcast sample shows how to use classes from VC components to build efficient audio broadcasting system. You can restart Clients and Server at any time. If changes were made in the format of audio stream being distributed by Server, Clients will synchronize with new format automatically without end-user interaction. DLL Encoder Demo (Mp3Demo)
It is possible to integrate external PCM stream encoders and decoders with VC components to produce custom audio files and streams, such as MP3 or Ogg/Vorbis. These formats may be not supported by installed ACM codecs and therefore external libraries are required. VC components has native support for Blade and Lame MP3 encoders, Vorbis/Ogg encoder and decoder, BASS library and MpgLib MP3 decoder library. Press the Copyrights button to get more information about these libraries. In DLL Encoder Demo all operations are performed in real-time, making it possible to use these engines for real-time audio streaming. Scriptor
Scriptor sample shows what and how you can do with that powerful tool. Icy Streamer
Icy Streamer sample shows how to stream live audio to specified SHOUTcast server, and how to receive and listen live stream from it. It uses Lame library to encode audio in MP3 format, and BASS or MpgLib library to decode it to PCM for playback. SHOUTCAST(TM) are copyright protected and are the property of Nullsoft, Inc. Multi-ConsumerIt is now possible to link one component with any number of other components (consumers). This makes it simple to distribute audio from one source to several destinations. In our Multi-Consumer sample you can add any number of consumers to live recording source at run-time.
For example, it is possible to stream audio to remote server(s) or client(s),
save it into local WAVe file(s) or listen it on live playback,
all at the same time.
Programmatically all you have to do is to use
the This feature dramatically reduces development time of complex audio processing applications. Distribution Server and Client (mediaGate)
Making conference-like communication applications with VC components is as easy as making peer-to-peer voice chat projects. Distribution Server and Client samples show how to distribute audio stream being received from remote source among several Clients. The process is shown on a picture below. One designated Client working in "speaker" mode connects to mediaGate server, which in turn distribute audio to "listeners". Listeners can connect and disconnect at any time, and Server will automatically assign next available channel for new Listener. In addition, this demo shows how to enable/disable audio distribution from server to selected clients. Disabled client remains connected, but does not receive any audio. Multicast source and end-point
UDP sockets have many applications which are not possible to achieve with TCP sockets. One of the application is multicast technology, where data is delivered to a group of recipients simultaneously. There should be a data source, which creates a group, produces the data and sends it over network, and number of end-points, which join some group or groups, announcing their interest, so network hardware may create the most efficient routing. Unlike with broadcasting, shows in our Broadcast demo, multicast streams may reach clients connected through Internet, not only LAN, and preserve hardware resource (like bandwidth) so much larger number of clients may be served at the same time.
All job is done by the Conference Server and Client
In many applications it may be needed to provide the ability for several clients to participate in one audio meeting or conference, where everyone can hear each other, just like in real life. When more than two clients are considered, some special audio processing may be needed to fulfill this task. Although it actually can be done with VC components and classes, not all developers are willing to dive into the details, and would rather prefer to re-use already working solution. That is why we have included the Conference Server and Conference Client samples into our package. The Server is responsible for accepting client connections, mixing audio data and feeding the clients with proper audio streams. It also provides ability for participants to exchange text information. Client can be any application based on our IpClient component, such as Talk Now, Voice Chat or similar samples, but we have also included another custom client with some additional features.
All job is done by |