libZPlay documentation (Win32)
IndexReferenceHome
PreviousUpNext
Open source line

Open wave-in.

libZPlay library can retrieve data from specified wave-in mixer line and play these data to wave-out. User can specify mixer line for recording and library will translate these recorded samples through all specified effects(equalizer, echo, pitch change, ...) to wave output. In real time. You can also use callback mechanism to get these samples and save them to disk file. 

New: To save/encode recorded samples to disk file just set wave-out file

To open wave-in use special stream format sfWaveIn or use special file name. 

 

Special file name format:

To use wave-in as input source specify following file name: 

wavein:// 

 

There are 3 additional, optional parameters you can use with wavein:// to specify additional features: 

src=mixer_line_id; 

name=(mixer_line_name); 

volume=volume_percent; 

 

Add these optional parameters to special file name after wavein:// without space. Order of these parameters is not prescribed. You don't need to specify all parameters. 

Warning:
These parameters are NOT working on Windows Vista and Windows 7. 

You need to select recording mixer line in mixer window.

 

Note:
Unspecified parameters will stay unchanged. If you don't specify src or name parameter, recording will go from currently selected recording line. If volume parameters is not specified, you will use currently selected volume from recording mixer. 

Example1: 

wavein:// - use current recording line with current volume.

 

 

src parameter

Use src parameter to specify mixer_line_id, input line from recording mixer. There are standard values for this parameter and these values should be the same for all computers and hardware. 

 

mixer_line_id 
Description 
line 
Audio line is a line-level source (for example, line-level input from an external stereo) that can be used as an optional recording source. 
line-in 
The same as line
microphone 
Audio line is a microphone recording source. 
mic 
The same as microphone
analog 
Audio line is an analog source (for example, analog output from a video-cassette tape). 
aux 
Audio line is a source originating from the auxiliary audio line. 
cd 
Audio line is a source originating from the output of an internal audio CD. 
digital 
Audio line is a digital source (for example, digital output from a DAT or audio CD). 
pcspeaker 
Audio line is a source originating from personal computer speaker. 
synthesizer 
Audio line is a source originating from the output of an internal synthesizer. 
midi 
The same as synthesizer
waveout 
Audio line is a source originating from the waveform-audio output digital-to-analog converter (DAC). 

 

Examples: 

wavein://src=line; - open wavein and try to select line-in recording source from recording mixer 

wavein://src=microphone; - open wavein and try to select microphone recording source from recording mixer. 

Warning:
There is no guaranty that src=line; will select line-in as recording source. All this depends on audio and mixer drivers on your computer. Library will try to select, in this case, line-in mixer recording source. But there can be problem if your mixer driver has different identification for actual line-in recording source. For example, analog identification can be identification type for real line-in source, ... Library will try to use recording mixer source based on specified mixer_line_id. If this don't work, you can specify name parameter.
 

 

name parameter

Use name parameter to specify mixer_line_name, input line from recording mixer. This parameter specifies description of recording mixer line. Description is text you can see on each line in mixer window. Mixer line description is specific for each audio and mixer driver. For example, cd input line can be described as "CD", "CD Player", "Compact Disk", ... 

This parameter has larger priority than src parameter. If you specify name and src parameters, name will be used and src will be ignored. 

Examples: 

wavein://name=(Line In); - open wavein and try to select recording source with description "Line In". 

wavein://name=(CD Audio); - open wavein and try to select recording source with description "CD Audio". 

wavein://src=microphone;name=(Line In); - microphone will be ignored. "Line In" will be selected. 

Note:
Line description is not standard identifier for mixer line. This depends on mixer driver. On some computer you can have line with "CD Player" description, and on the other computer this line will have "CD Audio" description. 

If you need standardized approach, use src parameter to specify mixer line.

 

 

volume parameter

With this parameter you can set volume of specified recording line. Volume range is 0 - 100. Of course, you also need to specify src or name parameter. 

Examples: 

wavein://src=microphone;volume=100; - open wavein and try to select microphone. Set volume to maximum. 

 

To open wave-in use following functions and specify wavein:// file name:  

C++ 
VB.NET 
C#.NET 
VC.NET 
Delphi 
 
 
 
 

 

At the end you need to close previous stream to free allocated resources. 

 

C++ 
VB.NET 
C#.NET 
VC.NET 
Delphi 

 

Open wavein microphone line, set volume to 50 % 

ZPlay C++ Class interface  

instance->OpenFile("wavein://src=microphone;volume=50;", sfAutodetect);

 

C Style interface

zplay_OpenFile(instance, "wavein://src=microphone;volume=50;", sfAutodetect);
Copyright (c) 2010. Zoran Cindori - All rights reserved.

Web: http://libzplay.sourceforge.net/

Email: zcindori@inet.hr