YMatchAudioModeValues - Audio mode matching
#include <Y2/Y.h>
#include <Y2/Ylib.h>
Boolean YMatchAudioModeValues(
YConnection *connection,
YAudioModeValuesStruct *buf,
int sample_rate,
int sample_size,
int channels,
int direction
)
The YMatchAudioModeValues function checks the given values with a list of Audio mode values obtained from the Y server. If an Audio mode who's values match the given values then True is returned and buf is set with the values of the matched Audio mode, otherwise False is returned.
The YMatchAudioModeValues function returns True if an Audio mode is matched or False if no match is made.
#include <stdio.h>
#include <Y2/Y.h>
#include <Y2/Ylib.h>
int main(int argc, char *argv[])
{
YAudioModeValuesStruct buf;
YConnection *con = YOpenConnection(
"/usr/sbin/starty",
"127.0.0.1:9433"
);
if(con == NULL)
return(1);
if(YMatchAudioModeValues(
con, &buf,
11025, /* 11025 Hz */
8, /* 8 bits */
2, /* Stereo */
0 /* Play */
))
printf(
"Matched Audio mode \"%s\"\n",
buf.name
);
YCloseConnection(con, False);
YGetAudioModes(3) YFreeAudioModesList(3) YChangeAudioModePreset(3)