15 using namespace Nsound;
23 float64 ratio = new_duration / x_dur;
29 return st.timeShift(x, ratio);
46 <<
"x2.getLength() = " << x2.
getLength() <<
"\n"
47 <<
"x1.getLength() = " << x1.
getLength() <<
"\n"
48 <<
"x0.getLength() = " << x0.
getLength() <<
"\n";
50 x2.
add(x0, 1.30 * dur - dur);
51 x2.
add(x1, 1.15 * dur - dur);
61 cout <<
"x2.getLength() = " << x2.
getLength() <<
"\n";
float64 getDuration() const
Returns the number of seconds of audio data in the stream.
float64 getSampleRate() const
Returns the sample rate of the stream.
uint32 getLength() const
Returns the number of samples of audio data in the stream.
AudioStream stretch_to(const AudioStream &x, float64 new_duration)
void normalize()
Multiplies the AudioStream by a constant gain so the peak sample has magnitude 1.0.
void showProgress(boolean flag)
void add(const AudioStream &as, uint32 offset, uint32 n_samples=0)
This method adds the passed AudioStream to this AudioStream.