YCalculateCycle(3)

YCalculateCycle3

Y server cycle interval calculation

Usage

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

long YCalculateCycle(

YConnection *connection,

int sample_rate,

int channels,

int sample_size,

int fragment_size
)

Arguments

connection

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

sample_rate

Specifies the sample rate in Hz.

channels

Specifies the number of channels.

sample_size

Specifies the sample size in bits.

fragment_size

Specifies the fragmented buffer size in bytes, must be a 2^n value.

Overview

The YCalculateCycle function calculates the theoretical cycle value in microseconds with respect to the given inputs. The input connection can be NULL, however if it is NULL then a less accurate and more generalized answer will be returned.

Return value

The YCalculateCycle returns the theoretical cycle value in microseconds. This value is not gauranteed to always work, cycle values defined on the Y server's preset Audio modes should be considered more accurate.

Examples

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

int main(int argc, char *argv[])
{

YConnection *con = YOpenConnection(

"/usr/sbin/starty",

"127.0.0.1:9433"

);

if(con == NULL)

return(1);

printf("Cycle %ld microseconds\n",

YCalculateCycle(

con, 11025, 2, 8, 1024

)

);

YCloseConnection(con, False);

return(0);
}

Releases

5 releases since Debian 3.0 (Woody); the text changed 1 time.

  1. 3.0
  2. 3.1–6.0

From liby-dev 2.14.5-7 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.