live
liveMedia
include
AudioInputDevice.hh
Go to the documentation of this file.
1
/**********
2
This library is free software; you can redistribute it and/or modify it under
3
the terms of the GNU Lesser General Public License as published by the
4
Free Software Foundation; either version 3 of the License, or (at your
5
option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
6
7
This library is distributed in the hope that it will be useful, but WITHOUT
8
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10
more details.
11
12
You should have received a copy of the GNU Lesser General Public License
13
along with this library; if not, write to the Free Software Foundation, Inc.,
14
51 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
27
class
AudioPortNames
{
28
public
:
29
AudioPortNames
();
30
virtual
~AudioPortNames
();
31
32
unsigned
numPorts
;
33
char
**
portName
;
34
};
35
36
class
AudioInputDevice
:
public
FramedSource
{
37
public
:
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);
49
static
AudioPortNames
*
getPortNames
();
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
55
protected
:
56
AudioInputDevice
(
UsageEnvironment
& env,
57
unsigned
char
bitsPerSample
,
58
unsigned
char
numChannels
,
59
unsigned
samplingFrequency
,
60
unsigned
granularityInMS);
61
// we're an abstract base class
62
63
virtual
~AudioInputDevice
();
64
65
protected
:
66
unsigned
char
fBitsPerSample
,
fNumChannels
;
67
unsigned
fSamplingFrequency
;
68
unsigned
fGranularityInMS
;
69
};
70
71
#endif
Boolean
unsigned char Boolean
Definition:
Boolean.hh:25
FramedSource.hh
AudioInputDevice
Definition:
AudioInputDevice.hh:36
AudioInputDevice::setInputPort
virtual Boolean setInputPort(int portIndex)=0
AudioInputDevice::bitsPerSample
unsigned char bitsPerSample() const
Definition:
AudioInputDevice.hh:38
AudioInputDevice::createNew
static AudioInputDevice * createNew(UsageEnvironment &env, int inputPortNumber, unsigned char bitsPerSample, unsigned char numChannels, unsigned samplingFrequency, unsigned granularityInMS=20)
AudioInputDevice::~AudioInputDevice
virtual ~AudioInputDevice()
AudioInputDevice::samplingFrequency
unsigned samplingFrequency() const
Definition:
AudioInputDevice.hh:40
AudioInputDevice::getPortNames
static AudioPortNames * getPortNames()
AudioInputDevice::allowedDeviceNames
static char ** allowedDeviceNames
Definition:
AudioInputDevice.hh:51
AudioInputDevice::numChannels
unsigned char numChannels() const
Definition:
AudioInputDevice.hh:39
AudioInputDevice::AudioInputDevice
AudioInputDevice(UsageEnvironment &env, unsigned char bitsPerSample, unsigned char numChannels, unsigned samplingFrequency, unsigned granularityInMS)
AudioInputDevice::fNumChannels
unsigned char fNumChannels
Definition:
AudioInputDevice.hh:66
AudioInputDevice::fBitsPerSample
unsigned char fBitsPerSample
Definition:
AudioInputDevice.hh:66
AudioInputDevice::getAverageLevel
virtual double getAverageLevel() const =0
AudioInputDevice::fGranularityInMS
unsigned fGranularityInMS
Definition:
AudioInputDevice.hh:68
AudioInputDevice::fSamplingFrequency
unsigned fSamplingFrequency
Definition:
AudioInputDevice.hh:67
AudioPortNames
Definition:
AudioInputDevice.hh:27
AudioPortNames::AudioPortNames
AudioPortNames()
AudioPortNames::portName
char ** portName
Definition:
AudioInputDevice.hh:33
AudioPortNames::~AudioPortNames
virtual ~AudioPortNames()
AudioPortNames::numPorts
unsigned numPorts
Definition:
AudioInputDevice.hh:32
FramedSource
Definition:
FramedSource.hh:31
UsageEnvironment
Definition:
UsageEnvironment.hh:53
Generated on Tue Jun 25 2024 22:52:35 for live by
1.9.5