#include <plib/sl.h>
#include <plib/sm.h>
+#include "soundmgr.hxx"
+
// Quoting from http://www.kluft.com/~ikluft/ham/morse-intro.html by
// Ian Kluft KO6YQ <ikluft@kluft.com>
// allocate and initialize sound samples
bool init();
+
+ // make a FGSimpleSound morse code transmission for the specified string
+ FGSimpleSound make_ident( const string& id );
};
volume_envelope->setStep ( 0, 0.01, 1.0 );
}
+FGSimpleSound::FGSimpleSound( unsigned char *buffer, int len ) {
+ sample = new slSample ( buffer, len );
+ pitch_envelope = new slEnvelope( 1, SL_SAMPLE_ONE_SHOT );
+ volume_envelope = new slEnvelope( 1, SL_SAMPLE_ONE_SHOT );
+ pitch_envelope->setStep ( 0, 0.01, 1.0 );
+ volume_envelope->setStep ( 0, 0.01, 1.0 );
+}
+
// destructor
FGSimpleSound::~FGSimpleSound() {
delete pitch_envelope;
public:
FGSimpleSound( string file );
+ FGSimpleSound( unsigned char *buffer, int len );
~FGSimpleSound();
inline double get_pitch() const { return pitch; }