Device – Giavapps ProAudio

pa_device_count() Retrieves the number of available devices. The number of available devices may be zero.

 

pa_device_info(DeviceIndex, InfoFlag) Retrieves the specified device info.

DeviceIndex: device index.
InfoFlag: info flag.

InfoFlag argument can be one of the following values:

PA_DEVICE_INFO_INPUT_CHANNELS Number of max input channels.

PA_DEVICE_INFO_INPUT_LOW_LATENCY Default latency values for interactive performance.

PA_DEVICE_INFO_INPUT_HIGH_LATENCY Default latency values for robust non-interactive applications (eg. playing sound files).

PA_DEVICE_INFO_OUTPUT_CHANNELS Number of max output channels.

PA_DEVICE_INFO_OUTPUT_LOW_LATENCY Default latency values for interactive performance.

PA_DEVICE_INFO_OUTPUT_HIGH_LATENCY Default latency values for robust non-interactive applications (eg. playing sound files).

PA_DEVICE_INFO_SAMPLE_RATE Default sample rate.

 

pa_device_name(DeviceIndex) Returns a string with the name of the specified device.

 

pa_device_input_default() Returns a DeviceIndex of the Default Input Device or -1 if no Default Input Device is available or an error was encountered.

 

pa_device_output_default() Returns a DeviceIndex of the Default Output Device or -1 if no Default Output Device is available or an error was encountered.

 

Code Examples

 

Checking Available Devices

 

device_count = pa_device_count();

for(d=0;d<device_count;d++)
{
show_message("DEVICE NAME: "+pa_device_name(d)
+"#INPUT CHANNELS: "+string(pa_device_info(d,PA_DEVICE_INFO_INPUT_CHANNELS))
+"#INPUT LOW LATENCY: "+string(pa_device_info(d,PA_DEVICE_INFO_INPUT_LOW_LATENCY))
+"#INPUT HIGH LATENCY: "+string(pa_device_info(d,PA_DEVICE_INFO_INPUT_HIGH_LATENCY))
+"#OUTPUT CHANNELS: "+string(pa_device_info(d,PA_DEVICE_INFO_OUTPUT_CHANNELS))
+"#OUTPUT LOW LATENCY: "+string(pa_device_info(d,PA_DEVICE_INFO_OUTPUT_LOW_LATENCY))
+"#OUTPUT HIGH LATENCY: "+string(pa_device_info(d,PA_DEVICE_INFO_OUTPUT_HIGH_LATENCY))
+"#SAMPLE RATE: "+string(pa_device_info(d,PA_DEVICE_INFO_SAMPLE_RATE))
);
}

 

Getting Default I/O Devices

 

show_message("DEFAULT INPUT DEVICE: "+string(pa_device_input_default())
+"#DEFAULT OUTPUT DEVICE: "+string(pa_device_output_default()));

 

I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and promotion.

Leave a Reply

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

*