audio_input.h 1.13 KB
Newer Older
jcaceres's avatar
jcaceres committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**********************************************************************
 * File: audio_input.h
 **********************************************************************
 * A project of the SoundWIRE research group at CCRMA
 * http://www-ccrma.stanford.edu/groups/soundwire/
 * --------------------------------------------------------------------
 * Coded by Daniel Walling (dwalling@ccrma.stanford.edu)
 * Based on Scott Wilson's streambd code (rswilson@ccrma.stanford.edu)
 * --------------------------------------------------------------------
 */

#ifndef	_AUDIO_INPUT_H
#define	_AUDIO_INPUT_H

#include "input_plugin.h"
#include "audioDevice.h"
#include "audioInfo.h"

/**
 * @brief Takes audio buffers from the audio device and sends them out
 * on a Stream.
 */

class AudioInput:public InputPlugin
{
      private:
	AudioDevice * audioDevice;
	AudioInfoT audioInfo;

	bool _running;		//!< True while the current thread is running. 

      public:

	  AudioInput (AudioDevice * audioDevice,
				  AudioInfoT audioInfo);
	 ~AudioInput ();
	void xfrFrom (void *buf);
	int rcv (char *buf);
	void run ();
	void stop ();
	void plotVal (double v);
};
#endif