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
30namespace jami {
31
32class Tone : public AudioLoop
33{
34public:
40 Tone(std::string_view definition, unsigned int sampleRate, AVSampleFormat sampleFormat);
41
44
52 static void genSin(AVFrame* buffer, size_t outPos, unsigned nb_samples, unsigned frequency1, unsigned frequency2);
53
54private:
59 void genBuffer(std::string_view definition);
60};
61
62} // namespace jami
Loop on a sound file.
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
ToneId
The different kind of tones.
Definition tone.h:43
void emitSignal(Args... args)
Definition ring_signal.h:64