Hello, I believe there is a problem with the system of audio queuing.
To prove that check this really simple project (direct link): simple audio project
This is reall easy to understand, please do not skip. Here's the the complete code in the test project:
Create Event: create a short buffer, and then copy it 1000 times to a long buffer
Event Key Press A: Queue 1000 copies of the SHORT buffer, and play it!
Event Key Press B: Queue only 1 copy of the LONG buffer, and play it!
You can clearly hear the difference when you press A (distorted sound), compared to when you press B (clean sound)
But it doesn't make any sense to me, since the process is similar.
To prove that check this really simple project (direct link): simple audio project
This is reall easy to understand, please do not skip. Here's the the complete code in the test project:
Create Event: create a short buffer, and then copy it 1000 times to a long buffer
GML:
sampleRate= 44100
//create short buffer
loop_Buff_short = buffer_create(36, buffer_fixed, 1)
buffer_write(loop_Buff_short,buffer_s16,1167)
buffer_write(loop_Buff_short,buffer_s16,10621)
buffer_write(loop_Buff_short,buffer_s16,18161)
buffer_write(loop_Buff_short,buffer_s16,26286)
buffer_write(loop_Buff_short,buffer_s16,28006)
buffer_write(loop_Buff_short,buffer_s16,22229)
buffer_write(loop_Buff_short,buffer_s16,19146)
buffer_write(loop_Buff_short,buffer_s16,14471)
buffer_write(loop_Buff_short,buffer_s16,5814)
buffer_write(loop_Buff_short,buffer_s16,-207)
buffer_write(loop_Buff_short,buffer_s16,-4970)
buffer_write(loop_Buff_short,buffer_s16,-10348)
buffer_write(loop_Buff_short,buffer_s16,-18214)
buffer_write(loop_Buff_short,buffer_s16,-24407)
buffer_write(loop_Buff_short,buffer_s16,-24897)
buffer_write(loop_Buff_short,buffer_s16,-25675)
buffer_write(loop_Buff_short,buffer_s16,-24386)
buffer_write(loop_Buff_short,buffer_s16,-14635)
//create long buffer which is 1000 copies of the short one
loop_Buff_long = buffer_create(36000, buffer_fixed, 1)
for (var i=0; i<=1000; i++)
{
buffer_copy(loop_Buff_short, 0, buffer_get_size(loop_Buff_short), loop_Buff_long,i*buffer_get_size(loop_Buff_short))
}
Event Key Press A: Queue 1000 copies of the SHORT buffer, and play it!
GML:
audio_queue_short = audio_create_play_queue(buffer_s16, sampleRate, audio_mono);
for (var i=1; i<=1000; i++)
{
audio_queue_sound(audio_queue_short,loop_Buff_short,0 ,buffer_get_size(loop_Buff_short));
}
audio_play_sound(audio_queue_short, 0, false);
Event Key Press B: Queue only 1 copy of the LONG buffer, and play it!
GML:
audio_queue_long = audio_create_play_queue(buffer_s16, sampleRate, audio_mono);
audio_queue_sound(audio_queue_long,loop_Buff_long,0 ,buffer_get_size(loop_Buff_long));
audio_play_sound(audio_queue_long, 0, false);
But it doesn't make any sense to me, since the process is similar.