diff --git a/src/Sound/VoiceSynthesizer.cxx b/src/Sound/VoiceSynthesizer.cxx index be1ecae85..408e3b990 100644 --- a/src/Sound/VoiceSynthesizer.cxx +++ b/src/Sound/VoiceSynthesizer.cxx @@ -16,6 +16,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +#include + #include "VoiceSynthesizer.hxx" #include
#include
@@ -127,7 +130,7 @@ SGSoundSample * FLITEVoiceSynthesizer::synthesize(const std::string & text, doub reinterpret_cast( data ), free }; - return new SGSoundSample(buf, + return new SGSoundSample(std::move(buf), count * sizeof(short), rate, SG_SAMPLE_MONO16); diff --git a/src/Sound/beacon.cxx b/src/Sound/beacon.cxx index fde5e3c66..591a35a5e 100644 --- a/src/Sound/beacon.cxx +++ b/src/Sound/beacon.cxx @@ -19,8 +19,9 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // -#include +#include #include +#include #include "beacon.hxx" @@ -68,7 +69,8 @@ bool FGBeacon::init() { } try { - inner = new SGSoundSample( inner_buf, INNER_SIZE, BYTES_PER_SECOND ); + inner = new SGSoundSample( std::move(inner_buf), + INNER_SIZE, BYTES_PER_SECOND ); inner->set_reference_dist( 10.0 ); inner->set_max_dist( 20.0 ); @@ -88,7 +90,8 @@ bool FGBeacon::init() { ptr += MIDDLE_DIT_LEN; memcpy( ptr, middle_dah, MIDDLE_DAH_LEN ); - middle = new SGSoundSample( middle_buf, MIDDLE_SIZE, BYTES_PER_SECOND); + middle = new SGSoundSample( std::move(middle_buf), + MIDDLE_SIZE, BYTES_PER_SECOND ); middle->set_reference_dist( 10.0 ); middle->set_max_dist( 20.0 ); @@ -103,7 +106,8 @@ bool FGBeacon::init() { ptr += OUTER_DAH_LEN; memcpy( ptr, outer_dah, OUTER_DAH_LEN ); - outer = new SGSoundSample( outer_buf, OUTER_SIZE, BYTES_PER_SECOND ); + outer = new SGSoundSample( std::move(outer_buf), OUTER_SIZE, + BYTES_PER_SECOND ); outer->set_reference_dist( 10.0 ); outer->set_max_dist( 20.0 ); } catch ( sg_io_exception &e ) { diff --git a/src/Sound/morse.cxx b/src/Sound/morse.cxx index ffef13c59..eefd1f094 100644 --- a/src/Sound/morse.cxx +++ b/src/Sound/morse.cxx @@ -26,8 +26,9 @@ #include +#include #include -#include +#include static const char DI = '1'; static const char DIT = '1'; @@ -235,7 +236,7 @@ SGSoundSample *FGMorse::make_ident( const std::string& id, const int freq ) { buf_ptr += SPACE_SIZE; // 4. create the simple sound and return - SGSoundSample *sample = new SGSoundSample( buffer, length, + SGSoundSample *sample = new SGSoundSample( std::move(buffer), length, BYTES_PER_SECOND ); sample->set_reference_dist( 10.0 );