YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
SoundUtils.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026-2026 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_SIG_SOUNDUTILS_H
7#define YARP_SIG_SOUNDUTILS_H
8
9#include <yarp/sig/Sound.h>
10
11namespace yarp::sig::utils {
12
23bool YARP_sig_API makeSawTooth(Sound& outSound, double duration_s=1.0, size_t channels=1, size_t sampleRate=16000, double frequency=1, size_t amplitude=30000);
24
35bool YARP_sig_API makeTone(Sound& outSound, double duration_s=1.0, size_t channels=1, size_t sampleRate=16000, double frequency=440, size_t amplitude=30000);
36
47bool YARP_sig_API makeSquareWave(Sound& outSound, double duration_s=1.0, size_t channels=1, size_t sampleRate=16000, double frequency=1, size_t amplitude=30000);
48
71Sound YARP_sig_API mix(const Sound& A, const Sound& B, double percentage);
72
73} // namespace yarp::sig::utils
74
75
76#endif // YARP_SIG_SOUNDUTILS_H
bool makeSawTooth(Sound &outSound, double duration_s=1.0, size_t channels=1, size_t sampleRate=16000, double frequency=1, size_t amplitude=30000)
Generate a sound containing a sawtooth signal.
Sound mix(const Sound &A, const Sound &B, double percentage)
Mixes two sounds together into a single sound.
bool makeTone(Sound &outSound, double duration_s=1.0, size_t channels=1, size_t sampleRate=16000, double frequency=440, size_t amplitude=30000)
Generate a sound containing a sine wave tone.
bool makeSquareWave(Sound &outSound, double duration_s=1.0, size_t channels=1, size_t sampleRate=16000, double frequency=1, size_t amplitude=30000)
Generate a sound containing a square wave signal.
#define YARP_sig_API
Definition api.h:18