| 35 | | Add a function to retrieve the actual sample rate of the stream: |
| | 35 | Provide a method to to retrieve the actual sample rate of the stream. This will be achieved by |
| | 36 | adding a sample rate field to the new PaStreamInfo structure defined in <A HREF="003-ImproveLatencySpecificationInterface.html">003 - Improve Latency Specification Interface</A> |
| | 37 | </P> |
| | 38 | |
| | 39 | <PRE> |
| | 40 | /** A structure containing unchanging information about an open stream. |
| | 41 | @see Pa_GetStreamInfo |
| | 42 | */ |
| | 43 | |
| | 44 | typedef struct PaStreamInfo{ |
| | 45 | ... |
| | 46 | |
| | 47 | /** The sample rate of the stream in Hertz (samples per second). In cases |
| | 48 | where the hardware sample rate is inaccurate and PortAudio is aware of it, |
| | 49 | the value of this field may be different from the sampleRate parameter |
| | 50 | passed to Pa_OpenStream(). If information about the actual hardware sample |
| | 51 | rate is not available, this field will have the same value as the sampleRate |
| | 52 | parameter passed to Pa_OpenStream(). |
| | 53 | */ |
| | 54 | double sampleRate; |
| | 55 | |
| | 56 | ... |
| | 57 | } PaStreamInfo; |
| | 58 | </PRE> |
| | 59 | |
| | 60 | |
| | 61 | <H4>Discussion</H4> |
| | 62 | |
| | 63 | <P>Initially the following function was proposed, however it was decided that it was better to |
| | 64 | place actual latency and sample rate information in a common structure to simplify the |
| | 65 | API for casual users. |