length += 2 * SPACE_SIZE;
// 2. Allocate space for the message
- unsigned char *buffer = new unsigned char[length];
+ const unsigned char* buffer = (const unsigned char *)malloc(length);
// 3. Assemble the message;
- unsigned char *buf_ptr = buffer;
+ unsigned char *buf_ptr = (unsigned char*)buffer;
for ( i = 0; i < (int)id.length(); ++i ) {
if ( idptr[i] >= 'A' && idptr[i] <= 'Z' ) {
buf_ptr += SPACE_SIZE;
// 4. create the simple sound and return
- SGSoundSample *sample = new SGSoundSample( buffer, length,
+ SGSoundSample *sample = new SGSoundSample( &buffer, length,
BYTES_PER_SECOND );
sample->set_reference_dist( 10.0 );