Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Toggle main menu visibility
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2019 Roc Streaming authors
3
*
4
* This Source Code Form is subject to the terms of the Mozilla Public
5
* License, v. 2.0. If a copy of the MPL was not distributed with this
6
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
*/
8
9
//! @file roc_sndio/config.h
10
//! @brief Sink and source config.
11
12
#ifndef ROC_SNDIO_CONFIG_H_
13
#define ROC_SNDIO_CONFIG_H_
14
15
#include "
roc_audio/sample_spec.h
"
16
#include "
roc_core/stddefs.h
"
17
#include "
roc_core/time.h
"
18
#include "
roc_packet/units.h
"
19
20
namespace
roc
{
21
namespace
sndio
{
22
23
//! Default frame length.
24
//! 10ms is rather high, but works well even on cheap sound cards and CPUs.
25
//! Usually you can use much lower values.
26
const
core::nanoseconds_t
DefaultFrameLength
= 10 *
core::Millisecond
;
27
28
//! Sink and source config.
29
struct
Config
{
30
//! Sample spec
31
audio::SampleSpec
sample_spec
;
32
33
//! Duration of the internal frames, in nanoseconds.
34
core::nanoseconds_t
frame_length
;
35
36
//! Requested input or output latency.
37
core::nanoseconds_t
latency
;
38
39
//! Initialize.
40
Config
()
41
:
frame_length
(
DefaultFrameLength
)
42
,
latency
(0) {
43
}
44
};
45
46
}
// namespace sndio
47
}
// namespace roc
48
49
#endif
// ROC_SNDIO_CONFIG_H_
roc::audio::SampleSpec
Sample specification. Describes sample rate and channels.
Definition
sample_spec.h:30
roc::core::Millisecond
const nanoseconds_t Millisecond
One millisecond represented in nanoseconds.
Definition
time.h:67
roc::core::nanoseconds_t
int64_t nanoseconds_t
Nanoseconds.
Definition
time.h:58
roc::sndio
Sound I/O.
roc::sndio::DefaultFrameLength
const core::nanoseconds_t DefaultFrameLength
Default frame length. 10ms is rather high, but works well even on cheap sound cards and CPUs....
Definition
config.h:26
roc
Root namespace.
sample_spec.h
Sample specifications.
stddefs.h
Commonly used types and functions.
roc::sndio::Config::Config
Config()
Initialize.
Definition
config.h:40
roc::sndio::Config::sample_spec
audio::SampleSpec sample_spec
Sample spec.
Definition
config.h:31
roc::sndio::Config::latency
core::nanoseconds_t latency
Requested input or output latency.
Definition
config.h:37
roc::sndio::Config::frame_length
core::nanoseconds_t frame_length
Duration of the internal frames, in nanoseconds.
Definition
config.h:34
time.h
Time definitions.
units.h
Various units used in packets.
roc_sndio
config.h
Generated by
1.17.0