1 /***************************************************** vim:set ts=4 sw=4 sts=4:
3 Speeds up or slows down an audio file by stretching the audio stream.
4 Uses the sox program to do the stretching.
7 (C) 2004 by Gary Cramblitt <garycramblitt@comcast.net>
9 Original author: Gary Cramblitt <garycramblitt@comcast.net>
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 ******************************************************************************/
31 #include <kdemacros.h>
35 class KDE_EXPORT Stretcher
: public QObject
{
42 explicit Stretcher(QObject
*parent
= 0, const char *name
= 0);
50 ssIdle
= 0, // Not doing anything. Ready to stretch.
51 ssStretching
= 1, // Stretching.
52 ssFinished
= 2 // Stretching finished.
56 * Stretch the given input file to an output file.
57 * @param inFilename Name of input audio file.
58 * @param outFilename Name of output audio file.
59 * @param stretchFactor Amount to stretch. 2.0 is twice as slow. 0.5 is twice as fast.
61 bool stretch(const QString
&inFilename
, const QString
&outFilename
, float stretchFactor
);
64 * Returns the state of the Stretcher.
69 * Returns the output filename (as given in call to stretch).
71 QString
getOutFilename();
74 * Acknowledges the finished stretching.
80 * Emitted whenever stretching is completed.
82 void stretchFinished();
85 void slotProcessExited(K3Process
* proc
);
92 K3Process
* m_stretchProc
;
95 QString m_outFilename
;