Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
IWriter.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright 2009-2016 Jörg Müller
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 ******************************************************************************/
16
17#pragma once
18
26
28
31{
32 CONTAINER_INVALID = 0,
33 CONTAINER_AC3,
34 CONTAINER_FLAC,
35 CONTAINER_MATROSKA,
36 CONTAINER_MP2,
37 CONTAINER_MP3,
38 CONTAINER_OGG,
39 CONTAINER_WAV
40};
41
44{
45 CODEC_INVALID = 0,
46 CODEC_AAC,
47 CODEC_AC3,
48 CODEC_FLAC,
49 CODEC_MP2,
50 CODEC_MP3,
51 CODEC_PCM,
52 CODEC_VORBIS,
53 CODEC_OPUS
54};
55
61{
62public:
66 virtual ~IWriter() {}
67
72 virtual int getPosition() const=0;
73
79 virtual DeviceSpecs getSpecs() const=0;
80
86 virtual void write(unsigned int length, sample_t* buffer)=0;
87};
88
#define AUD_NAMESPACE_END
Closes the audaspace namespace aud.
Definition Audaspace.h:119
float sample_t
Sample type.(float samples)
Definition Audaspace.h:126
#define AUD_NAMESPACE_BEGIN
Opens the audaspace namespace aud.
Definition Audaspace.h:116
#define AUD_API
Used for exporting symbols in the shared library.
Definition Audaspace.h:93
Container
Container formats for writers.
Definition IWriter.h:31
Codec
Audio codecs for writers.
Definition IWriter.h:44
Defines all important macros and basic data structures for stream format descriptions.
This class represents a sound sink where audio data can be written to.
Definition IWriter.h:61
virtual int getPosition() const =0
Returns how many samples have been written so far.
virtual void write(unsigned int length, sample_t *buffer)=0
Request to write the next length samples out into the sink.
virtual ~IWriter()
Destroys the writer.
Definition IWriter.h:66
virtual DeviceSpecs getSpecs() const =0
Returns the specification of the audio data being written into the sink.
Specification of a sound device.
Definition Specification.h:129