AudioPlayer improvements

Playing audio files at Speed different than 1, throws this error after playing the file once in loop.

IndexOutOfRangeException: "Index was outside the bounds of the array."
    StackTrace:
        VL.Audio.BufferWiseResampler { public void ResampleDeinterleave(float[] source, float[][] dest, int sourceSamples, int destSamples, int channels) { ... } } 
        VL.Audio.FileStreamSignal { protected virtual void FillBuffers(float[][] buffer, int offset, int sampleCount) { ... } } 
        VL.Audio.SingleSignal { protected virtual void FillBuffer(float[] buffer, int offset, int count) { ... } } 
        VL.Audio.ResamplerPullBuffer { public virtual void Pull(int count) { ... } } 
        VL.Audio.CircularPullBuffer { public int Read(float[] data, int offset, int count) { ... } } 
        VL.Audio.AudioSignal { public virtual int Read(float[] buffer, int offset, int count) { ... } } 
        VL.Audio.MasterWaveProvider { public virtual int Read(byte[] buffer, int offset, int count) { ... } } 


indeed, the new resampler didn’t play well with the existing one for the speed adjustments. please test with latest release where i combined the two. sounds smooth to me now in all known cases.

I didn’t try it deeply but seems to work now.
Thank you so much!

Hey everyone,

Is there any other workaround for this issue in v7? I’ve tried both the Resample node and the Speed Change methods, but neither seems to work properly in my case. The Resample node doesn’t produce the correct result (even when used as shown in previous posts), and while changing the speed comes close, the pitch difference is still noticeable.

Both methods also tend to introduce clicks when the audio is played in a loop.

For reference, I’m using a 48,000 kHz file, and my output device is set to 44,100 kHz.

can you share the issue in a way so we can reproduce it?

Sure! Here’s a test patch with 3 audio players. My device sample rate is set to 44100, sound sample rate is 48000:

I’ve tested it in v7 and v6.7

In v7 every AudioPlayer produces incorrect result - resampling doesn’t seem to affect audio signal at all. Speed change makes it better, but still the pitch is wrong compared to original sound, and sometimes on some samples it introduces cliks when played in loop - I belive the issue here is somehow related to simplified approach to “resampling”. Also, changing speed doesn’t automatically recalculate sound duration, which can be inconvinient in cases when you rely on that value

Weirdly enough in v6.7 AudioPlayer works out-of-the-box, without resampling and speed change workarounds.

In v7 I temporary solved this issue by converting everything to match device settings, but in the long run that is not a reliable solution since I couldn’t be sure about different devices settings

sound.zip (2.0 MB)

AudioplayerTest.vl (23.6 KB)

There is still something weird going on with the AudioPlayer. I have an audio player in my patch and it just refuses to play anything. All inputs are set correctly.

I then created a new patch with just an audio player and again same thing. No output:

Then I found this thread again and thought I would just place down DriverSettings to see whats up and as soon as I placed it, it started playing. I then removed DriverSettings and even after F9 it remains playable.

What’s strange though is that in my other large patch I DO have DriverSettings and it still refuses to play.

So something is still off and the seemingly simple task of playing an audio file in vvvv still remains challenging.