---
name: "YGetAudioModes"
section: "3"
platform: "linux"
package: "liby-dev"
version: "2.14.5-7"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/YGetAudioModes"
---

# YGetAudioModes(3)

Audio mode list retrieving

## NAME

YGetAudioModes - Audio mode list retrieving

## SYNTAX

\#include \<Y2/Y.h\>\
 \#include \<Y2/Ylib.h\>

YAudioModeValuesStruct \*\*YGetAudioModes(\
\
         YConnection \**connection*,\
\
         int \**count*\
 )

typedef struct {

        char name\[YAudioNameMax\];

        int sample\_rate;\
\
         int channels;\
\
         int sample\_size;\
\
         int fragment\_size\_bytes;\
\
         char direction;\
\
         char allow\_fragmenting;\
\
         int num\_fragments;

} YAudioModeValuesStruct;

## ARGUMENTS

- *connection*

  Specifies the connection to the Y server, obtained by a call to YOpenConnection.

- *count*

  Specifies a pointer to an int that will indicate the number of dynamically allocated YAudioModeValuesStruct structures returned.

## DESCRIPTION

The YGetAudioModes function fetches a list of Audio mode names and their values from the Y server.

## RETURN VALUE

The YGetAudioModes function returns a pointer to an array of pointers of YAudioModeValuesStruct structures. The returned pointer needs to be deallocated by calling YFreeAudioModesList.

Can return NULL on error.

## EXAMPLE

\#include \<stdio.h\>\
 \#include \<Y2/Y.h\>\
 \#include \<Y2/Ylib.h\>

int main(int argc, char \*argv\[\])\
 {\
\
         YAudioModeValuesStruct \*\*list;\
\
         int count;\
\
         YConnection \*con = YOpenConnection(\
\
                 "/usr/sbin/starty",\
\
                 "127.0.0.1:9433"\
\
         );\
\
         if(con == NULL)\
\
                 [return(1)](/return/1.md);

        list = YGetAudioModes(con, &count);

        YFreeAudioModesList(list, count);

        YCloseConnection(con, False);

        return(0);\
 }

## SEE ALSO

[YFreeAudioModesList(3)](/YFreeAudioModesList/3.md) [YChangeAudioModePreset(3)](/YChangeAudioModePreset/3.md) [YMatchAudioModeValues(3)](/YMatchAudioModeValues/3.md)
