live
AudioInputDevice.hh
Go to the documentation of this file.
1/**********
2This library is free software; you can redistribute it and/or modify it under
3the terms of the GNU Lesser General Public License as published by the
4Free Software Foundation; either version 3 of the License, or (at your
5option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
6
7This library is distributed in the hope that it will be useful, but WITHOUT
8ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10more details.
11
12You should have received a copy of the GNU Lesser General Public License
13along with this library; if not, write to the Free Software Foundation, Inc.,
1451 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15**********/
16// Copyright (c) 1996-2024 Live Networks, Inc. All rights reserved.
17// Generic audio input device (such as a microphone, or an input sound card)
18// C++ header
19
20#ifndef _AUDIO_INPUT_DEVICE_HH
21#define _AUDIO_INPUT_DEVICE_HH
22
23#ifndef _FRAMED_SOURCE_HH
24#include "FramedSource.hh"
25#endif
26
28public:
30 virtual ~AudioPortNames();
31
32 unsigned numPorts;
33 char** portName;
34};
35
37public:
38 unsigned char bitsPerSample() const { return fBitsPerSample; }
39 unsigned char numChannels() const { return fNumChannels; }
40 unsigned samplingFrequency() const { return fSamplingFrequency; }
41
42 virtual Boolean setInputPort(int portIndex) = 0;
43 virtual double getAverageLevel() const = 0;
44
45 static AudioInputDevice*
46 createNew(UsageEnvironment& env, int inputPortNumber,
47 unsigned char bitsPerSample, unsigned char numChannels,
48 unsigned samplingFrequency, unsigned granularityInMS = 20);
50
51 static char** allowedDeviceNames;
52 // If this is set to non-NULL, then it's a NULL-terminated array of strings
53 // of device names that we are allowed to access.
54
55protected:
57 unsigned char bitsPerSample,
58 unsigned char numChannels,
59 unsigned samplingFrequency,
60 unsigned granularityInMS);
61 // we're an abstract base class
62
64
65protected:
69};
70
71#endif
unsigned char Boolean
Definition: Boolean.hh:25
virtual Boolean setInputPort(int portIndex)=0
unsigned char bitsPerSample() const
static AudioInputDevice * createNew(UsageEnvironment &env, int inputPortNumber, unsigned char bitsPerSample, unsigned char numChannels, unsigned samplingFrequency, unsigned granularityInMS=20)
virtual ~AudioInputDevice()
unsigned samplingFrequency() const
static AudioPortNames * getPortNames()
static char ** allowedDeviceNames
unsigned char numChannels() const
AudioInputDevice(UsageEnvironment &env, unsigned char bitsPerSample, unsigned char numChannels, unsigned samplingFrequency, unsigned granularityInMS)
unsigned char fNumChannels
unsigned char fBitsPerSample
virtual double getAverageLevel() const =0
unsigned fSamplingFrequency
virtual ~AudioPortNames()