Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
sox_backend.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 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/target_sox/roc_sndio/sox_backend.h
10//! @brief SoX backend.
11
12#ifndef ROC_SNDIO_SOX_BACKEND_H_
13#define ROC_SNDIO_SOX_BACKEND_H_
14
15#include <sox.h>
16
19#include "roc_sndio/ibackend.h"
20
21namespace roc {
22namespace sndio {
23
24//! SoX backend.
26public:
27 SoxBackend();
28
29 //! Set internal SoX frame size.
30 //! @remarks
31 //! Number of samples for all channels.
33 const audio::SampleSpec& sample_spec);
34
35 //! Append supported drivers to the list.
37
38 //! Create and open a sink or source.
39 virtual ITerminal* open_terminal(TerminalType terminal_type,
40 DriverType driver_type,
41 const char* driver,
42 const char* path,
43 const Config& config,
44 core::IAllocator& allocator);
45
46private:
47 bool first_created_;
48};
49
50} // namespace sndio
51} // namespace roc
52
53#endif // ROC_SNDIO_SOX_BACKEND_H_
Sample stream specification. Defines sample rate and channel layout.
Definition sample_spec.h:24
Dynamic array.
Definition array.h:38
Memory allocator interface.
Definition iallocator.h:23
Base class for non-copyable objects.
Definition noncopyable.h:23
Backend interface.
Definition ibackend.h:29
Base interface for sinks and sources.
Definition iterminal.h:23
void set_frame_size(core::nanoseconds_t frame_length, const audio::SampleSpec &sample_spec)
Set internal SoX frame size.
virtual void discover_drivers(core::Array< DriverInfo, MaxDrivers > &driver_list)
Append supported drivers to the list.
virtual ITerminal * open_terminal(TerminalType terminal_type, DriverType driver_type, const char *driver, const char *path, const Config &config, core::IAllocator &allocator)
Create and open a sink or source.
Backend interface.
int64_t nanoseconds_t
Nanoseconds.
Definition time.h:58
TerminalType
Terminal type.
DriverType
Driver type.
Definition driver.h:27
Root namespace.
Non-copyable object.
Sample specifications.
Sink and source config.
Definition config.h:23