1 /*
2  * Copyright (C) 2005, Magnus Hjorth
3  *
4  * This file is part of mhWaveEdit.
5  *
6  * mhWaveEdit is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * mhWaveEdit is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with mhWaveEdit; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 
22 /* Code for "guessing" the real sample rate and total buffer size
23  * without using any special sound driver calls, by logging time
24  * and size of succesful writes. */
25 
26 #ifndef RATEEST_H_INCLUDED
27 #define RATEEST_H_INCLUDED
28 
29 #include "main.h"
30 
31 /* Reset and setup estimator */
32 void rateest_init(guint expected_samplerate);
33 /* Call this whenever data has been sent to sound driver */
34 void rateest_log_data(guint frames);
35 /* Call this to account for data sent earlier */
36 void rateest_prelog_data(guint frames);
37 /* Number of logged written frames. */
38 off_t rateest_frames_written(void);
39 /* Estimate of number of actually played frames. */
40 off_t rateest_frames_played(void);
41 /* Estimate of real sample rate */
42 gfloat rateest_real_samplerate(void);
43 
44 
45 #endif
46