Ring Daemon
16.0.0
Loading...
Searching...
No Matches
tone.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2004-2025 Savoir-faire Linux Inc.
3
*
4
* Inspired by tonegenerator of
5
* Laurielle Lea <laurielle.lea@savoirfairelinux.com> (2004)
6
*
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <https://www.gnu.org/licenses/>.
19
*/
20
#pragma once
21
22
#include <string>
23
#include "
audio/audioloop.h
"
24
30
namespace
jami
{
31
32
class
Tone
:
public
AudioLoop
33
{
34
public
:
40
Tone
(std::string_view
definition
,
unsigned
int
sampleRate,
AVSampleFormat
sampleFormat);
41
43
enum class
ToneId
{
DIALTONE
= 0,
BUSY
,
RINGTONE
,
CONGESTION
,
TONE_NULL
};
44
52
static
void
genSin
(
AVFrame
*
buffer
,
size_t
outPos
,
unsigned
nb_samples
,
unsigned
frequency1
,
unsigned
frequency2
);
53
54
private
:
59
void
genBuffer(std::string_view
definition
);
60
};
61
62
}
// namespace jami
audioloop.h
Loop on a sound file.
jami::AudioLoop
Definition
audioloop.h:39
jami::Tone
Definition
tone.h:33
jami::Tone::genSin
static void genSin(AVFrame *buffer, size_t outPos, unsigned nb_samples, unsigned frequency1, unsigned frequency2)
Add a simple or double sin to the buffer, it double the sin in stereo.
Definition
tone.cpp:111
jami::Tone::ToneId
ToneId
The different kind of tones.
Definition
tone.h:43
jami::Tone::ToneId::DIALTONE
@ DIALTONE
jami::Tone::ToneId::RINGTONE
@ RINGTONE
jami::Tone::ToneId::BUSY
@ BUSY
jami::Tone::ToneId::CONGESTION
@ CONGESTION
jami::Tone::ToneId::TONE_NULL
@ TONE_NULL
jami
Definition
account.cpp:61
jami::emitSignal
void emitSignal(Args... args)
Definition
ring_signal.h:64
src
media
audio
sound
tone.h
Generated on Thu Jun 19 2025 15:50:37 for Ring Daemon by
1.9.8