Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions configs/dcrp808_noloop.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# test config bs11.16 page, waveform, 11 conditions, no looping


testname: Degradation Category Rating (DCR)
testId: dcr_test
bufferSize: 2048
stopOnErrors: true
showButtonPreviousPage: true
remoteService: service/write.php


pages:

- type: dcrp808
id: trial1
name: DMOS Quality Assessment
content: ' DCR Test'
showWaveform: false
enableLooping: false
createAnchor35: false
createAnchor70: false
reference: configs/resources/audio/mono_c1.wav
stimuli:
stim1: configs/resources/audio/mono_c1.wav

- type: finish
name: Thank you
content: Thank you for attending
showResults: true
writeResults: true
15 changes: 15 additions & 0 deletions design/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ body.ui-mobile-viewport, div.ui-mobile-viewport {
position: relative;
}

#tableDCRP808 {
border-spacing: 0.4em;
position: relative;
}


td.logo {
padding: 0 0.5em 0 0.5em;
}
Expand Down Expand Up @@ -132,6 +138,10 @@ td.stopButton {
width:13em;
}

#DCRP808conditionNameScale {
width:13em;
}

#buttonStop, .audioControlElement {
width: 5.5em !important;
margin : 0 auto;
Expand Down Expand Up @@ -198,6 +208,11 @@ td.stopButton {
margin : 0 auto;
}

#buttonPlayReference {
margin-left:0em !important;
margin : 0 auto;
}

/* justifications of the display of the slider values */
.limits {
width:4em !important;
Expand Down
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<!-- audio -->
<script src="lib/webmushra/audio/AudioFileLoader.js"></script>
<script src="lib/webmushra/audio/MushraAudioControl.js"></script>
<script src="lib/webmushra/audio/DCRP808AudioControl.js"></script>
<script src="lib/webmushra/audio/GenericAudioControl.js"></script>

<!-- business -->
Expand All @@ -71,11 +72,13 @@
<!-- control -->
<script src="lib/webmushra/control/MushraAudioControlInputController.js"></script>
<script src="lib/webmushra/control/BS1116AudioControlInputController.js"></script>
<script src="lib/webmushra/control/DCRP808AudioControlInputController.js"></script>
<script src="lib/webmushra/control/FilePlayerController.js"></script>
<script src="lib/webmushra/control/InputController.js"></script>

<!-- datamodel -->
<script src="lib/webmushra/datamodel/BS1116Rating.js"></script>
<script src="lib/webmushra/datamodel/DCRP808Rating.js"></script>
<script src="lib/webmushra/datamodel/MUSHRARating.js"></script>
<script src="lib/webmushra/datamodel/LikertMultiStimulusRating.js"></script>
<script src="lib/webmushra/datamodel/LikertSingleStimulusRating.js"></script>
Expand Down Expand Up @@ -106,7 +109,9 @@

<!-- pages -->
<script src="lib/webmushra/pages/BS1116Page.js"></script>
<script src="lib/webmushra/pages/DCRP808Page.js"></script>
<script src="lib/webmushra/pages/BS1116PageManager.js"></script>
<script src="lib/webmushra/pages/DCRP808PageManager.js"></script>
<script src="lib/webmushra/pages/FinishPage.js"></script>
<script src="lib/webmushra/pages/GenericPage.js"></script>
<script src="lib/webmushra/pages/ConsentPage.js"></script>
Expand Down
559 changes: 559 additions & 0 deletions lib/webmushra/audio/DCRP808AudioControl.js

Large diffs are not rendered by default.

172 changes: 172 additions & 0 deletions lib/webmushra/control/DCRP808AudioControlInputController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
/*************************************************************************
(C) Copyright AudioLabs 2017

This source code is protected by copyright law and international treaties. This source code is made available to You subject to the terms and conditions of the Software License for the webMUSHRA.js Software. Said terms and conditions have been made available to You prior to Your download of this source code. By downloading this source code You agree to be bound by the above mentionend terms and conditions, which can also be found here: https://www.audiolabs-erlangen.de/resources/webMUSHRA. Any unauthorised use of this source code may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under law.

**************************************************************************/

function DCRP808AudioControlInputController(_mushraAudioControl, _looping){
this.mushraAudioControl = _mushraAudioControl;
this.looping = _looping;
}


DCRP808AudioControlInputController.prototype.bind = function(){

var conditions = this.mushraAudioControl.getConditions();
Mousetrap.bind(['r', '0', 'space'], function() { $('#buttonPlayReference').click(); });
Mousetrap.bind(['backspace'], function() { $('#buttonStop').click(); });
Mousetrap.bind(['enter'], function() { $('#__button_next').click(); });
Mousetrap.bind(['shift+enter'], function() { $('#__button_next').click(); });
Mousetrap.bind(['space'], (function() { var firstPageCall = false;
for(var j = 0; j < conditions.length; j++){
if($('#buttonConditions' + j).attr('active') == 'true'){
if(this.mushraAudioControl.audioPlaying != true){
this.mushraAudioControl.setPosition(this.mushraAudioControl.audioLoopStart);
}
$('#buttonConditions' + j).click();
firstPageCall = false;
break;
}else if($('#buttonPlayReference').attr('active') == 'true'){
if(this.mushraAudioControl.audioPlaying != true){
this.mushraAudioControl.setPosition(this.mushraAudioControl.audioLoopStart);
}
firstPageCall = false;
break;
}else{
firstPageCall = true;
}
}
if(firstPageCall == true){
$('#buttonPlayReference').click();
}
}).bind(this));

var duration = this.mushraAudioControl.getDuration();
if (this.looping) {
Mousetrap.bind(['a'], function() { this.pageManager.getCurrentPage().setLoopStart(); });
Mousetrap.bind(['b'], function() { this.pageManager.getCurrentPage().setLoopEnd(); });
Mousetrap.bind(['B'], (function() { this.mushraAudioControl.setLoopEnd(duration); }).bind(this));
Mousetrap.bind(['A'], (function() { this.mushraAudioControl.setLoopStart(0); }).bind(this));
}

for (i = 0; i < conditions.length; ++i) {
(function(i) {
Mousetrap.bind(String(i + 1), function() { $('#buttonConditions' + i).click(); });
Mousetrap.bind(['l'], function() {
if($('#buttonPlayReference').attr('active') == 'true'){
$('#buttonConditions0').click();
}else if($('#buttonConditions' + (conditions.length - 1)).attr('active') == 'true'){
$('#buttonPlayReference').click();
}else{
for(var k = 0; k < conditions.length - 1; ++k){
if($('#buttonConditions' + k).attr('active') == 'true'){
var next = k + 1;
$('#buttonConditions' + next).click();
break;
}
}
}
});
Mousetrap.bind(['h'], function() {
if($('#buttonPlayReference').attr('active') == 'true'){
$('#buttonConditions' + (conditions.length - 1)).click();
}else if($('#buttonConditions0').attr('active') == 'true'){
$('#buttonPlayReference').click();
}else{
for(var l = 1; l < conditions.length; ++l){
if($('#buttonConditions' + l).attr('active') == 'true'){
var previous = l - 1;
$('#buttonConditions' + previous).click();
break;
}
}
}
});
Mousetrap.bind(['up', 'j', 'shift+up', 'shift+j'], function(e, combo) {
addVal = 0;
if (combo.indexOf('shift') != -1 ) {
addVal = 1;
} else {
addVal = 0.01;
}
for(j = 0; j < conditions.length; ++j){
var slider = $('.scales').get(j);
if($(slider).attr('active') == 'true'){

var newValue = parseFloat($(slider).val()) + addVal;
$(slider).val(newValue.toString());
$(slider).slider().slider('refresh');
break;
}
}
return false;
});

Mousetrap.bind(['down', 'k', 'shift+down', 'shift+k'], function(e, combo) {
addVal = 0;
if (combo.indexOf('shift') != -1 ) {
addVal = 1;
} else {
addVal = 0.01;
}
for(j = 0; j < conditions.length; ++j){
var slider = $('.scales').get(j);
if($(slider).attr('active') == 'true'){

var newValue = parseFloat($(slider).val()) - addVal;
$(slider).val(newValue.toString());
$(slider).slider().slider('refresh');
break;
}
}
return false;
});
})(i);
}

document.onkeydown = function (event) { // prevents backspace to go back

if (!event) { /* This will happen in IE */
event = window.event;
}

var keyCode = event.keyCode;

if (keyCode == 8 &&
((event.target || event.srcElement).tagName != "TEXTAREA") &&
((event.target || event.srcElement).tagName != "INPUT")) {

if (navigator.userAgent.toLowerCase().indexOf("msie") == -1) {
event.stopPropagation();
} else {
alert("prevented");
event.returnValue = false;
}

return false;
} else if (keyCode == 32 && // prevents space bar to scroll down
((event.target || event.srcElement).tagName != "TEXTAREA") &&
((event.target || event.srcElement).tagName != "INPUT")) {

if (navigator.userAgent.toLowerCase().indexOf("msie") == -1) {
event.stopPropagation();
} else {
alert("prevented");
event.returnValue = false;
}

return false;
}
};

};


DCRP808AudioControlInputController.prototype.unbind = function(){
Mousetrap.unbind(['r', '0', 'a', 'b', 'A', 'B', 'j', 'backspace', 'space', 'k', 'h', 'l', 'enter', 'shift+enter']);
var conditions = this.mushraAudioControl.getConditions();
for (i = 0; i < conditions.length; ++i) {
Mousetrap.unbind(String(i + 1));
}
};
15 changes: 15 additions & 0 deletions lib/webmushra/datamodel/DCRP808Rating.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*************************************************************************
(C) Copyright AudioLabs 2017

This source code is protected by copyright law and international treaties. This source code is made available to You subject to the terms and conditions of the Software License for the webMUSHRA.js Software. Said terms and conditions have been made available to You prior to Your download of this source code. By downloading this source code You agree to be bound by the above mentionend terms and conditions, which can also be found here: https://www.audiolabs-erlangen.de/resources/webMUSHRA. Any unauthorised use of this source code may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under law.

**************************************************************************/

function DCRP808Rating() {
this.reference = null;
this.nonReference = null;
this.referenceScore = null;
this.nonReferenceScore = null;
this.comment = null;
this.time = null;
}
12 changes: 12 additions & 0 deletions lib/webmushra/nls/nls.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ nls['en']['playButton'] = "Play";
nls['en']['stopButton'] = "Stop";
nls['en']['pauseButton'] = "Pause";
nls['en']['sendButton'] = "Send Results";
nls['en']['refButton'] = "Reference";
nls['en']['condButton'] = "Processed";

nls['de']['nextButton'] = "Nächste Seite";
nls['de']['previousButton'] = "Vorherige Seite";
nls['de']['playButton'] = "Start";
nls['de']['stopButton'] = "Stopp";
nls['de']['pauseButton'] = "Pause";
nls['de']['sendButton'] = "Ergebnisse senden";
nls['de']['refButton'] = "Reference";
nls['de']['condButton'] = "Processed";

nls['fr']['nextButton'] = "Suivant";
nls['fr']['previousButton'] = "Précédent";
Expand Down Expand Up @@ -74,6 +78,14 @@ nls['es']['cond'] = "Estado";
nls['es']['35'] = "Ancla35";
nls['es']['75'] = "Ancla75";


// captions DCRP808
nls['en']['dcr_excellent'] = "Degradation is inaudible";
nls['en']['dcr_good'] = "Degradation is audible but not annoying";
nls['en']['dcr_fair'] = "Degradation is slightly annoying";
nls['en']['dcr_poor'] = "Degradation is annoying";
nls['en']['dcr_bad'] = "Degradation is very annoying";

// captions BS1116

nls['en']['imperceptible'] = "Imperceptible";
Expand Down
Loading