\hypertarget{mysound_8h}{}\doxysection{inc/mysound.h File Reference}
\label{mysound_8h}\index{inc/mysound.h@{inc/mysound.h}}
{\ttfamily \#include \char`\"{}config.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}myarr.\+h\char`\"{}}\newline
{\ttfamily \#include $<$alsa/asoundlib.\+h$>$}\newline
{\ttfamily \#include $<$stdio.\+h$>$}\newline
Include dependency graph for mysound.\+h\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{mysound_8h__incl}
\end{center}
\end{figure}
This graph shows which files directly or indirectly include this file\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{mysound_8h__dep__incl}
\end{center}
\end{figure}
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{structAmpResult}{Amp\+Result}}
\item 
struct \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}}
\begin{DoxyCompactList}\small\item\em Context for audio capture, containing ALSA parameters and configuration. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} \mbox{\hyperlink{mysound_8h_a6bcb80ca2e3c5ad2ec3e67389f7049e6}{Capture\+Ctx}}
\begin{DoxyCompactList}\small\item\em Context for audio capture, containing ALSA parameters and configuration. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \mbox{\hyperlink{mysound_8h_a19fd732c6566678a83efb08084b64c6a}{open\+\_\+capture\+\_\+elem}} (\mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} $\ast$ctx, const \mbox{\hyperlink{structCapConfig}{Cap\+Config}} $\ast$cfg)
\begin{DoxyCompactList}\small\item\em Open the ALSA mixer and find the \textquotesingle{}Capture\textquotesingle{} element for microphone control. \end{DoxyCompactList}\item 
const char $\ast$ \mbox{\hyperlink{mysound_8h_a335a86e7bb84220e0e05b8e89dde135b}{get\+\_\+default\+\_\+device}} (void)
\begin{DoxyCompactList}\small\item\em Retrieves the default ALSA audio capture device, preferring sysdefault devices with \textquotesingle{}usb\textquotesingle{} in their description. \end{DoxyCompactList}\item 
snd\+\_\+pcm\+\_\+t $\ast$ \mbox{\hyperlink{mysound_8h_a48f8c4cb9fd9917352fd118141aa4501}{init\+Audio}} (snd\+\_\+pcm\+\_\+format\+\_\+t format, char $\ast$device, unsigned int $\ast$rate)
\begin{DoxyCompactList}\small\item\em Initializes the ALSA audio capture device with the specified format, device name, and sample rate. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{mysound_8h_a9eb1bfb6d399e3b6e7b537cd422c2654}{init\+Audio\+Source}} (\mbox{\hyperlink{structCapConfig}{Cap\+Config}} $\ast$cfg, unsigned int $\ast$actual\+Rate)
\begin{DoxyCompactList}\small\item\em Initializes the audio source for capture based on the provided configuration. This function sets up the ALSA capture device and retrieves the actual sample rate being used. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{mysound_8h_aa310cc9b4cfd0f227a9e3143a101393f}{read\+Buffer\+Or\+File}} (int $\ast$derivative, size\+\_\+t Array\+Length, FILE $\ast$fp\+Input, \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} $\ast$ctx, int16\+\_\+t $\ast$buffer16)
\begin{DoxyCompactList}\small\item\em Reads audio data from the capture device or a file into a buffer. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{mysound_8h_a4c693ee8e2155813d63204597ee13447}{get\+Data}} (FILE $\ast$fp\+Input, struct \mbox{\hyperlink{structmyarr}{myarr}} $\ast$derivative, \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} $\ast$ctx, int16\+\_\+t $\ast$out)
\begin{DoxyCompactList}\small\item\em Retrieves audio data from the capture context or input file and processes it into a derivative array. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{mysound_8h_af0c1c5f075f1e4df5e7d6606a4909b84}{capture\+Teardown}} (\mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} $\ast$ctx)
\begin{DoxyCompactList}\small\item\em Cleans up and releases resources associated with the audio capture context. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{mysound_8h_a470c1d105d80aa605f7c57a0247b3c63}{capture\+Setup}} (\mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} $\ast$ctx, \mbox{\hyperlink{structCapConfig}{Cap\+Config}} $\ast$cfg, unsigned int rate)
\begin{DoxyCompactList}\small\item\em Sets up the ALSA audio capture device based on the provided context and configuration. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{mysound_8h_a839355f40bec4ad51529e11ca71ac843}{read\+Samples}} (snd\+\_\+pcm\+\_\+t $\ast$cap, size\+\_\+t Array\+Length, int16\+\_\+t $\ast$out)
\begin{DoxyCompactList}\small\item\em Reads audio samples from the ALSA capture device into a buffer. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{mysound_8h_a54b162f247c2b5a30d97466af6320412}{get\+\_\+mic\+\_\+amplification}} (const \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} $\ast$ctx, long $\ast$value)
\begin{DoxyCompactList}\small\item\em Get the current microphone amplification (capture volume) from ALSA mixer. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{mysound_8h_a9813c32cfc7c4c332daca0aa44874b95}{set\+\_\+mic\+\_\+amplification}} (const \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} $\ast$ctx, long value)
\begin{DoxyCompactList}\small\item\em Set the microphone amplification (capture volume) using ALSA mixer. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Typedef Documentation}
\mbox{\Hypertarget{mysound_8h_a6bcb80ca2e3c5ad2ec3e67389f7049e6}\label{mysound_8h_a6bcb80ca2e3c5ad2ec3e67389f7049e6}} 
\index{mysound.h@{mysound.h}!CaptureCtx@{CaptureCtx}}
\index{CaptureCtx@{CaptureCtx}!mysound.h@{mysound.h}}
\doxysubsubsection{\texorpdfstring{CaptureCtx}{CaptureCtx}}
{\footnotesize\ttfamily typedef struct \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}}}



Context for audio capture, containing ALSA parameters and configuration. 


\begin{DoxyItemize}
\item 
\end{DoxyItemize}

\doxysubsection{Function Documentation}
\mbox{\Hypertarget{mysound_8h_a470c1d105d80aa605f7c57a0247b3c63}\label{mysound_8h_a470c1d105d80aa605f7c57a0247b3c63}} 
\index{mysound.h@{mysound.h}!captureSetup@{captureSetup}}
\index{captureSetup@{captureSetup}!mysound.h@{mysound.h}}
\doxysubsubsection{\texorpdfstring{captureSetup()}{captureSetup()}}
{\footnotesize\ttfamily int capture\+Setup (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} $\ast$}]{ctx,  }\item[{\mbox{\hyperlink{structCapConfig}{Cap\+Config}} $\ast$}]{cfg,  }\item[{unsigned int}]{rate }\end{DoxyParamCaption})}



Sets up the ALSA audio capture device based on the provided context and configuration. 


\begin{DoxyItemize}
\item This function configures the ALSA capture device according to the parameters specified in the \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} structure and the \mbox{\hyperlink{structCapConfig}{Cap\+Config}} configuration. It initializes the capture device and prepares it for audio data capture.
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em ctx} & A pointer to the \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} structure containing the capture context and configuration. \\
\hline
{\em cfg} & A pointer to the \mbox{\hyperlink{structCapConfig}{Cap\+Config}} structure containing the desired configuration for audio capture. \\
\hline
{\em rate} & The sample rate to be used for audio capture. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An integer status code (0 for success, non-\/zero for failure).
\end{DoxyReturn}
Sets up the ALSA audio capture device based on the provided context and configuration.


\begin{DoxyItemize}
\item Accepts an already-\/opened/initialized ALSA handle (from init\+Audio).
\item Computes Array\+Length = rate $\ast$ SECS\+\_\+\+HOUR $\ast$ 2 / bph
\item Queries period\+Size and builds poll descriptors. 
\end{DoxyItemize}\mbox{\Hypertarget{mysound_8h_af0c1c5f075f1e4df5e7d6606a4909b84}\label{mysound_8h_af0c1c5f075f1e4df5e7d6606a4909b84}} 
\index{mysound.h@{mysound.h}!captureTeardown@{captureTeardown}}
\index{captureTeardown@{captureTeardown}!mysound.h@{mysound.h}}
\doxysubsubsection{\texorpdfstring{captureTeardown()}{captureTeardown()}}
{\footnotesize\ttfamily void capture\+Teardown (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} $\ast$}]{ctx }\end{DoxyParamCaption})}



Cleans up and releases resources associated with the audio capture context. 


\begin{DoxyItemize}
\item This function resets the \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} structure, effectively releasing any resources associated with the audio capture context. It is important to call this function when the capture context is no longer needed to prevent resource leaks.
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em ctx} & A pointer to the \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} structure to be cleaned up. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{mysound_8h_a335a86e7bb84220e0e05b8e89dde135b}\label{mysound_8h_a335a86e7bb84220e0e05b8e89dde135b}} 
\index{mysound.h@{mysound.h}!get\_default\_device@{get\_default\_device}}
\index{get\_default\_device@{get\_default\_device}!mysound.h@{mysound.h}}
\doxysubsubsection{\texorpdfstring{get\_default\_device()}{get\_default\_device()}}
{\footnotesize\ttfamily const char $\ast$ get\+\_\+default\+\_\+device (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}



Retrieves the default ALSA audio capture device, preferring sysdefault devices with \textquotesingle{}usb\textquotesingle{} in their description. 

This function executes the \textquotesingle{}arecord -\/L\textquotesingle{} command to list available ALSA devices and parses the output to find a suitable default device. It first looks for devices with \textquotesingle{}sysdefault\+:\textquotesingle{} in their name and \textquotesingle{}usb\textquotesingle{} in their description. If such a device is found, it is returned as the default. If no USB sysdefault device is found, it falls back to any sysdefault device. If no sysdefault devices are found, it returns \textquotesingle{}default\textquotesingle{}. \begin{DoxyReturn}{Returns}
A string representing the default ALSA device to use for audio capture. 
\end{DoxyReturn}
\mbox{\Hypertarget{mysound_8h_a54b162f247c2b5a30d97466af6320412}\label{mysound_8h_a54b162f247c2b5a30d97466af6320412}} 
\index{mysound.h@{mysound.h}!get\_mic\_amplification@{get\_mic\_amplification}}
\index{get\_mic\_amplification@{get\_mic\_amplification}!mysound.h@{mysound.h}}
\doxysubsubsection{\texorpdfstring{get\_mic\_amplification()}{get\_mic\_amplification()}}
{\footnotesize\ttfamily int get\+\_\+mic\+\_\+amplification (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} $\ast$}]{ctx,  }\item[{long $\ast$}]{value }\end{DoxyParamCaption})}



Get the current microphone amplification (capture volume) from ALSA mixer. 

This function queries the ALSA mixer for the current capture volume (microphone gain) for the specified capture context.


\begin{DoxyParams}{Parameters}
{\em ctx} & Pointer to the \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} containing the mixer handle and element. \\
\hline
{\em value} & Output pointer for the amplification value. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 on failure. 
\end{DoxyReturn}
\mbox{\Hypertarget{mysound_8h_a4c693ee8e2155813d63204597ee13447}\label{mysound_8h_a4c693ee8e2155813d63204597ee13447}} 
\index{mysound.h@{mysound.h}!getData@{getData}}
\index{getData@{getData}!mysound.h@{mysound.h}}
\doxysubsubsection{\texorpdfstring{getData()}{getData()}}
{\footnotesize\ttfamily int get\+Data (\begin{DoxyParamCaption}\item[{FILE $\ast$}]{fp\+Input,  }\item[{struct \mbox{\hyperlink{structmyarr}{myarr}} $\ast$}]{derivative,  }\item[{\mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} $\ast$}]{ctx,  }\item[{int16\+\_\+t $\ast$}]{out }\end{DoxyParamCaption})}



Retrieves audio data from the capture context or input file and processes it into a derivative array. 


\begin{DoxyItemize}
\item This function reads audio samples from the ALSA capture device or from a specified input file, depending on the context. The read samples are stored in the provided output buffer, and a derivative array is computed based on the raw audio samples.
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em fp\+Input} & A pointer to a FILE object representing the input file to read from. If NULL, audio will be read from the capture device. \\
\hline
{\em derivative} & A pointer to a myarr structure where the computed derivative values will be stored. \\
\hline
{\em ctx} & A pointer to the \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} structure containing the capture context and configuration. \\
\hline
{\em out} & A pointer to an int16\+\_\+t array where the raw audio samples will be stored before being processed into the derivative array. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An integer status code (0 for success, non-\/zero for failure). 
\end{DoxyReturn}
\mbox{\Hypertarget{mysound_8h_a48f8c4cb9fd9917352fd118141aa4501}\label{mysound_8h_a48f8c4cb9fd9917352fd118141aa4501}} 
\index{mysound.h@{mysound.h}!initAudio@{initAudio}}
\index{initAudio@{initAudio}!mysound.h@{mysound.h}}
\doxysubsubsection{\texorpdfstring{initAudio()}{initAudio()}}
{\footnotesize\ttfamily snd\+\_\+pcm\+\_\+t $\ast$ init\+Audio (\begin{DoxyParamCaption}\item[{snd\+\_\+pcm\+\_\+format\+\_\+t}]{format,  }\item[{char $\ast$}]{device,  }\item[{unsigned int $\ast$}]{rate }\end{DoxyParamCaption})}



Initializes the ALSA audio capture device with the specified format, device name, and sample rate. 


\begin{DoxyItemize}
\item 
\begin{DoxyParams}{Parameters}
{\em format} & The audio format to use (e.\+g., SND\+\_\+\+PCM\+\_\+\+FORMAT\+\_\+\+S16\+\_\+\+LE). \\
\hline
{\em device} & The name of the ALSA device to open (e.\+g., \char`\"{}default\char`\"{}). \\
\hline
{\em rate} & A pointer to an unsigned int where the actual sample rate will be stored. This may be modified if the requested rate is not supported. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A pointer to the initialized snd\+\_\+pcm\+\_\+t capture handle, or NULL on failure. 
\end{DoxyReturn}

\end{DoxyItemize}\mbox{\Hypertarget{mysound_8h_a9eb1bfb6d399e3b6e7b537cd422c2654}\label{mysound_8h_a9eb1bfb6d399e3b6e7b537cd422c2654}} 
\index{mysound.h@{mysound.h}!initAudioSource@{initAudioSource}}
\index{initAudioSource@{initAudioSource}!mysound.h@{mysound.h}}
\doxysubsubsection{\texorpdfstring{initAudioSource()}{initAudioSource()}}
{\footnotesize\ttfamily int init\+Audio\+Source (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structCapConfig}{Cap\+Config}} $\ast$}]{cfg,  }\item[{unsigned int $\ast$}]{actual\+Rate }\end{DoxyParamCaption})}



Initializes the audio source for capture based on the provided configuration. This function sets up the ALSA capture device and retrieves the actual sample rate being used. 


\begin{DoxyItemize}
\item 
\begin{DoxyParams}{Parameters}
{\em cfg} & A pointer to the \mbox{\hyperlink{structCapConfig}{Cap\+Config}} structure containing the desired configuration for audio capture. \\
\hline
{\em actual\+Rate} & A pointer to an unsigned int where the actual sample rate will be stored after initialization. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An integer status code (0 for success, non-\/zero for failure). 
\end{DoxyReturn}

\end{DoxyItemize}\mbox{\Hypertarget{mysound_8h_a19fd732c6566678a83efb08084b64c6a}\label{mysound_8h_a19fd732c6566678a83efb08084b64c6a}} 
\index{mysound.h@{mysound.h}!open\_capture\_elem@{open\_capture\_elem}}
\index{open\_capture\_elem@{open\_capture\_elem}!mysound.h@{mysound.h}}
\doxysubsubsection{\texorpdfstring{open\_capture\_elem()}{open\_capture\_elem()}}
{\footnotesize\ttfamily void open\+\_\+capture\+\_\+elem (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} $\ast$}]{ctx,  }\item[{const \mbox{\hyperlink{structCapConfig}{Cap\+Config}} $\ast$}]{cfg }\end{DoxyParamCaption})}



Open the ALSA mixer and find the \textquotesingle{}Capture\textquotesingle{} element for microphone control. 

This function checks if the mixer handle and element are already stored in the configuration. If not, it opens the mixer, attaches to the specified device, registers simple elements, loads the mixer, and finds the \textquotesingle{}Capture\textquotesingle{} element. The found element is stored in the configuration for future use.


\begin{DoxyParams}{Parameters}
{\em ctx} & Capture context to store the mixer handle and element. \\
\hline
{\em cfg} & Configuration containing device information and mixer state. \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{mysound_8h_aa310cc9b4cfd0f227a9e3143a101393f}\label{mysound_8h_aa310cc9b4cfd0f227a9e3143a101393f}} 
\index{mysound.h@{mysound.h}!readBufferOrFile@{readBufferOrFile}}
\index{readBufferOrFile@{readBufferOrFile}!mysound.h@{mysound.h}}
\doxysubsubsection{\texorpdfstring{readBufferOrFile()}{readBufferOrFile()}}
{\footnotesize\ttfamily int read\+Buffer\+Or\+File (\begin{DoxyParamCaption}\item[{int $\ast$}]{derivative,  }\item[{size\+\_\+t}]{Array\+Length,  }\item[{FILE $\ast$}]{fp\+Input,  }\item[{\mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} $\ast$}]{ctx,  }\item[{int16\+\_\+t $\ast$}]{buffer16 }\end{DoxyParamCaption})}



Reads audio data from the capture device or a file into a buffer. 


\begin{DoxyItemize}
\item This function reads audio samples from the ALSA capture device or from a specified input file, depending on the context. The read samples are stored in the provided buffer.
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em derivative} & A pointer to an integer array where the read audio samples will be stored. \\
\hline
{\em Array\+Length} & The number of audio samples to read into the buffer. \\
\hline
{\em fp\+Input} & A pointer to a FILE object representing the input file to read from. If NULL, audio will be read from the capture device. \\
\hline
{\em ctx} & A pointer to the \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} structure containing the capture context and configuration. \\
\hline
{\em buffer16} & A pointer to an int16\+\_\+t array where the raw audio samples will be stored before being processed into the derivative array. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An integer status code (0 for success, non-\/zero for failure). 
\end{DoxyReturn}
\mbox{\Hypertarget{mysound_8h_a839355f40bec4ad51529e11ca71ac843}\label{mysound_8h_a839355f40bec4ad51529e11ca71ac843}} 
\index{mysound.h@{mysound.h}!readSamples@{readSamples}}
\index{readSamples@{readSamples}!mysound.h@{mysound.h}}
\doxysubsubsection{\texorpdfstring{readSamples()}{readSamples()}}
{\footnotesize\ttfamily int read\+Samples (\begin{DoxyParamCaption}\item[{snd\+\_\+pcm\+\_\+t $\ast$}]{cap,  }\item[{size\+\_\+t}]{Array\+Length,  }\item[{int16\+\_\+t $\ast$}]{out }\end{DoxyParamCaption})}



Reads audio samples from the ALSA capture device into a buffer. 


\begin{DoxyItemize}
\item This function reads a specified number of audio samples from the ALSA capture device and stores them in the provided output buffer. It handles potential errors such as EAGAIN (no data available) and XRUN (buffer underrun) by implementing appropriate recovery strategies.
\end{DoxyItemize}


\begin{DoxyParams}{Parameters}
{\em cap} & A pointer to the snd\+\_\+pcm\+\_\+t capture handle representing the ALSA capture device. \\
\hline
{\em Array\+Length} & The number of audio samples to read into the output buffer. \\
\hline
{\em out} & A pointer to an int16\+\_\+t array where the read audio samples will be stored. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The number of samples successfully read, or a negative error code on failure. 
\end{DoxyReturn}
\mbox{\Hypertarget{mysound_8h_a9813c32cfc7c4c332daca0aa44874b95}\label{mysound_8h_a9813c32cfc7c4c332daca0aa44874b95}} 
\index{mysound.h@{mysound.h}!set\_mic\_amplification@{set\_mic\_amplification}}
\index{set\_mic\_amplification@{set\_mic\_amplification}!mysound.h@{mysound.h}}
\doxysubsubsection{\texorpdfstring{set\_mic\_amplification()}{set\_mic\_amplification()}}
{\footnotesize\ttfamily int set\+\_\+mic\+\_\+amplification (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} $\ast$}]{ctx,  }\item[{long}]{value }\end{DoxyParamCaption})}



Set the microphone amplification (capture volume) using ALSA mixer. 

This function sets the ALSA mixer capture volume (microphone gain) to the specified value for the given capture context. The value should be within the hardware limits stored in the context\textquotesingle{}s \mbox{\hyperlink{structAmpResult}{Amp\+Result}} struct.


\begin{DoxyParams}{Parameters}
{\em ctx} & Pointer to the \mbox{\hyperlink{structCaptureCtx}{Capture\+Ctx}} containing the mixer handle and element. \\
\hline
{\em value} & The amplification value to set. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 on failure. 
\end{DoxyReturn}
