audiolabs / webMUSHRA

a MUSHRA compliant web audio API based experiment software

Home Page:https://audiolabs.github.io/webMUSHRA/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multichannel Audio Reproduction

YorgosMoiragias opened this issue · comments

Hi to everyone,
I am trying to play an audio file of 6 channels (5.1) (96000 KHz, 24 bit) on a MUSHRA page via MOTU 828x. Although all of the 6 speakers reproduce the signal, it is highly distorted. However, when I use 16 bits per sample the audio reproduction is fine. The sound card supports both 16 and 24 bits per sample at 96000 kHz.
Is this a problem of the webMUSHRA code and is there any idea on how it can be solved?

Thanks in advance!

@YorgosMoiragias this might be browser dependent. Did you try on google chrome as well as firefox or safari?

also have you checked the javascript console for errors?

We do check for sample rate missmatches:

MushraValidator.prototype.checkSamplerate = function(_sampleRateDevice, _stimulus) {
if (_sampleRateDevice != _stimulus.getAudioBuffer().sampleRate) {
this.errorHandler.sendError("Sample rate of device and stimulus (" + _stimulus.getId() + " is different.");
return false;
}
return true;
};

Thanks for your response.
I have tried to load my config in all the available browsers and its only Firefox that is able to load it.
No such error ("Sample rate of device and stimulus") is appeared through loading and I believe that it is not a sample rate issue ( I have tried multiple sample rates, as far as my sound card can reproduce).

I don't think we've ever tested 24bit files and i'm actually not sure about the browser status.

@YorgosMoiragias can you test your files with the native html5 audio tag?

I wrote a html script like this:

audio src="resources/audio/mono_c2_5ch.wav" controls autoplay>

The same problem is appearing. This kind of clipping when multichannel audio with 24 bits per sample is reproduced.
An interesting observation is that when the audio has only 2 channels the reproduction is just fine ! Adding more channels (even if they are zero !! ) distorts the audio .

New information

The audio is reproduced fine, if I use flac codec at 24 bit depth.
Maybe firefox does not support wav multichannel files at 24 bit (a network-bandwidth issue? )
Another interesting observation , that maybe give an intuition into the problem, is that using a lower sampling rate (e.g. 44100 Hz) alters the distortion of the reproduced multichannel audio .

Okay. This is very weird, indeed.
I guess we should add a note to the readme that 24bit support is unstable.

Did you try with 32bit float?

It's getting more interesting , because the 32bit float files are reproduced fine.

okay, then i think we can close this and add warning in the readme. converting 24bit int to 32bit float is lossless and a good workaround, you agree?

Yes indeed. Another workaround is to convert the wav files to flac, again a lossless process.
Thanks for your assistance !!