File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -265,18 +265,18 @@ class SquareWaveGenerator : public SineWaveGenerator<T> {
265
265
template <class T >
266
266
class NoiseGenerator : public SoundGenerator <T> {
267
267
public:
268
- // the scale defines the max value which is generated
269
- NoiseGenerator (double scale= 1.0 ) {
270
- this ->scale = scale ;
268
+ // / the scale defines the max value which is generated
269
+ NoiseGenerator (T amplitude = 32767 ) {
270
+ this ->amplitude = amplitude ;
271
271
}
272
272
273
273
// / Provides a single sample
274
274
T readSample () {
275
- return (( rand () % ( static_cast <T>( 2 * scale)) - scale )); // generate number between -scale / scale
275
+ return ( random (-amplitude, amplitude ));
276
276
}
277
277
278
278
protected:
279
- double scale ;
279
+ T amplitude ;
280
280
281
281
};
282
282
You can’t perform that action at this time.
0 commit comments