master
waqarulzafar 2023-10-12 01:07:28 +05:00
parent 0af18395fd
commit c784f3f4ce
10 changed files with 4418 additions and 4446 deletions

BIN
.DS_Store vendored

Binary file not shown.

2
.idea/deployment.xml Executable file → Normal file
View File

@ -5,7 +5,7 @@
<paths name="craveteck"> <paths name="craveteck">
<serverdata> <serverdata>
<mappings> <mappings>
<mapping deploy="/var/www/mindbost.craveteck.com" local="$PROJECT_DIR$" web="/" /> <mapping deploy="/var/www/mindboost.craveteck.pk" local="$PROJECT_DIR$" web="/" />
</mappings> </mappings>
</serverdata> </serverdata>
</paths> </paths>

2
.idea/sshConfigs.xml Executable file → Normal file
View File

@ -2,7 +2,7 @@
<project version="4"> <project version="4">
<component name="SshConfigs"> <component name="SshConfigs">
<configs> <configs>
<sshConfig host="46.101.77.136" id="21fb0bf5-1d7f-4512-bd29-b1d0309d6ffe" keyPath="$USER_HOME$/Documents/server keys/main Server/mykey.ppk" port="22" nameFormat="DESCRIPTIVE" username="root" useOpenSSHConfig="true" /> <sshConfig host="138.197.70.61" id="21fb0bf5-1d7f-4512-bd29-b1d0309d6ffe" keyPath="$USER_HOME$/Documents/digitalocean" port="22" nameFormat="DESCRIPTIVE" username="root" useOpenSSHConfig="true" />
</configs> </configs>
</component> </component>
</project> </project>

2
.idea/webServers.xml Executable file → Normal file
View File

@ -3,7 +3,7 @@
<component name="WebServers"> <component name="WebServers">
<option name="servers"> <option name="servers">
<webServer id="20d7843e-0e96-481a-8bed-9d6b23084f02" name="craveteck"> <webServer id="20d7843e-0e96-481a-8bed-9d6b23084f02" name="craveteck">
<fileTransfer accessType="SFTP" host="46.101.77.136" port="22" sshConfigId="21fb0bf5-1d7f-4512-bd29-b1d0309d6ffe" sshConfig="root@46.101.77.136:22 key" keyPair="true"> <fileTransfer accessType="SFTP" host="138.197.70.61" port="22" sshConfigId="21fb0bf5-1d7f-4512-bd29-b1d0309d6ffe" sshConfig="root@138.197.70.61:22 key" keyPair="true">
<advancedOptions> <advancedOptions>
<advancedOptions dataProtectionLevel="Private" keepAliveTimeout="0" passiveMode="true" shareSSLContext="true" /> <advancedOptions dataProtectionLevel="Private" keepAliveTimeout="0" passiveMode="true" shareSSLContext="true" />
</advancedOptions> </advancedOptions>

View File

@ -123,7 +123,7 @@ export default {
// this.$toast.success('Login Successfully....'); // this.$toast.success('Login Successfully....');
this.$router.push(this.localePath('/onboarding')); this.$router.push(this.localePath('/onboarding/selectinput'));
}else{ }else{
this.$toast.error(`Email or password is incorrect.`); this.$toast.error(`Email or password is incorrect.`);
@ -151,4 +151,4 @@ export default {
.videobg-content{ .videobg-content{
overflow: auto !important; overflow: auto !important;
} }
</style> </style>

View File

@ -5,8 +5,13 @@
<div class="row"> <div class="row">
<div class="col-md-3 form-group"> <div class="col-md-3 form-group">
<label>Attack Time:</label> <label>Attack Time:</label>
<input type="text" v-model="timeRamp" class="form-control" placeholder="Enter time ramp to increase or decrease smoothing"> <input type="text" v-model="attackTime" class="form-control" placeholder="Enter time ramp to increase or decrease smoothing">
</div> </div>
<div class="col-md-3 form-group">
<label>Release Time:</label>
<input type="text" v-model="releaseTime" class="form-control" placeholder="Enter time ramp to increase or decrease smoothing">
</div>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<div class="row"> <div class="row">
@ -168,7 +173,7 @@ export default {
selectedOutputDevice: "", selectedOutputDevice: "",
inputDevices: [], inputDevices: [],
outputDevices: [], outputDevices: [],
timeRamp:4, timeRamp:11,
// This object holds all state of the app // This object holds all state of the app
classes: [ classes: [
@ -348,6 +353,10 @@ export default {
harmonicGainNode:{}, harmonicGainNode:{},
currentDestination:{}, currentDestination:{},
compressorNode:{}, compressorNode:{},
attackTime:25,
releaseTime:30,
targetValue:0,
currentValue:0,
} }
}, },
@ -511,10 +520,6 @@ export default {
}, },
frame() { frame() {
// if (this.height == 100) {
// this.stopmeasurement();
// console.log(this.LevelValues);
//console.log("Before",this.LevelValues65);
this.Percentile_Global= this.Percentile(this.LevelValues,0); this.Percentile_Global= this.Percentile(this.LevelValues,0);
this.Percentile_65=this.Percentile(this.LevelValues65,65) this.Percentile_65=this.Percentile(this.LevelValues65,65)
@ -526,23 +531,10 @@ export default {
this.Percentile_4000=this.Percentile(this.LevelValues4000,4000) this.Percentile_4000=this.Percentile(this.LevelValues4000,4000)
this.Percentile_8000=this.Percentile(this.LevelValues8000,8000) this.Percentile_8000=this.Percentile(this.LevelValues8000,8000)
this.Percentile_16000=this.Percentile(this.LevelValues16000,16000) this.Percentile_16000=this.Percentile(this.LevelValues16000,16000)
// this.Percentile(this.LevelValues65);
// this.ResetLevelValues();
// console.log("After",this.LevelValues65);
this.height++; this.height++;
// this.ResetLevelValues();
// console.log("OK");
// }
// else {
// this.height++;
// console.log(this.height);
// this.value = this.height+2;
// console.log(this.height);
// if (this.height % 4 == 0){
// this.secondsDown = 25 - (this.height/4);
// }
// }
}, },
startmeasurement() { startmeasurement() {
@ -566,58 +558,17 @@ export default {
if(this.timeHeight>40){ if(this.timeHeight>40){
this.frame(); this.frame();
// this.reset25();
// console.log("Array Counter",this.ArrayCounter); var linearGain = (this.Percentile_1000.percentile - 0) / (10 - 0);
// console.log("Last",this.lastArrayCouhter); // const linearGain = (Math.pow(10, this.Percentile_1000.percentile / 20))*0.5;
// this.lastArrayCouhter=this.ArrayCounter; // this.envelop(this.maxGain1000*this.Percentile_1000.percentile);
const dBFSValue = 20 * Math.log10(this.Percentile_1000.percentile / 1); this.envelop(linearGain);
console.log("dbfs",dBFSValue);
this.maskingGain1000=dBFSValue;
// // this.Gain.setValueAtTime(dBFSValue,this.audioCtx.currentTime);
// const gainValue = Math.pow(10, dBFSValue / 20);
// console.log(gainValue);
// this.Gain1000.gain.setValueAtTime(gainValue, this.audioCtx.currentTime);
console.log('Linear Gian',linearGain);
// this.logarithmicSmooth(linearGain,5,10);
var gainValue = Math.pow(10, this.Percentile_1000.percentile / 20);
// this.Gain1000.gain.value = gainValue;
console.log(this.maxGain1000);
let linearGain = this.maxGain1000 * gainValue;
// const rmsValue = this.DBFStoRMS(this.Percentile_1000.percentile, -18);
// const gainValue = this.RMStoGain(rmsValue);
// this.Gain1000.gain.setValueAtTime(linearGain, this.audioCtx.currentTime);
// define the time (in seconds) to ramp up/down to the target gain value
// const rampTime = 1.025;
const rampTime = this.timeRamp;
// const rampTime = 2;
// define the time (in seconds) to start the ramp up/down
const startTime = this.audioCtx.currentTime;
// this.Gain1000.gain.cancelScheduledValues(startTime);
this.Gain1000.gain.setTargetAtTime(linearGain, startTime,parseFloat(rampTime));
// this.Gain1000.gain.value=linearGain;
console.log(linearGain);
// this.compressorNode.threshold.setValueAtTime(-2, startTime);
// this.compressorNode.knee.setValueAtTime(20, startTime);
// this.compressorNode.ratio.setValueAtTime(12, startTime);
// this.compressorNode.attack.setValueAtTime(0.125, startTime);
// this.compressorNode.release.setValueAtTime(0.75, startTime);
// this.Gain1000.gain.value=0;
} }
// console.log(this.ArrayCounter);
// console.log("Last",this.lastArrayCouhter);
// this.lastArrayCouhter=this.ArrayCounter;
// if(this.timeHeight <= 0){
// this.firstArrayCounter=this.ArrayCounter;
// // console.log("First",this.firstArrayCounter);
// }
++this.timeHeight ++this.timeHeight
this.totalms+=125; this.totalms+=125;
@ -631,7 +582,26 @@ export default {
this.harmonicGainNode.gain.setValueAtTime(this.harmonicGain,this.audioCtx.currentTime); this.harmonicGainNode.gain.setValueAtTime(this.harmonicGain,this.audioCtx.currentTime);
},this.Timeframe) },this.Timeframe)
}, },
envelop(targetValue){
const now = this.audioCtx.currentTime;
// Cancel all previous Schedule
this.Gain1000.gain.cancelScheduledValues(now);
//Set the value for the previous gain
this.Gain1000.gain.setValueAtTime(this.currentValue, now);
//Linear ramp to the the attack time normal 25s
this.Gain1000.gain.linearRampToValueAtTime(targetValue, now + this.attackTime);
// Set Target
this.Gain1000.gain.setTargetAtTime(targetValue, now + this.attackTime, this.releaseTime);
// Store the current value for the next iteration
this.currentValue = this.Gain1000.gain.value;
console.log('Current Value',this.currentValue);
// Use the target value for audio processing or as needed
console.log("Target Value:", targetValue);
},
CancleMeasurement() { CancleMeasurement() {
this.stopmeasurement(); this.stopmeasurement();
this.previousPage(); this.previousPage();
@ -653,7 +623,8 @@ export default {
this.AnalyserbandPass2000.getByteTimeDomainData(this.bandPass2000Buffer) this.AnalyserbandPass2000.getByteTimeDomainData(this.bandPass2000Buffer)
this.AnalyserbandPass4000.getByteTimeDomainData(this.bandPass4000Buffer) this.AnalyserbandPass4000.getByteTimeDomainData(this.bandPass4000Buffer)
this.AnalyserbandPass8000.getByteTimeDomainData(this.bandPass8000Buffer) this.AnalyserbandPass8000.getByteTimeDomainData(this.bandPass8000Buffer)
this.AnalyserbandPass16000.getByteTimeDomainData(this.bandPass16000Buffer) this.AnalyserbandPass16000.getByteTimeDomainData(this.bandPass16000Buffer);
// console.log('Buffer 1000',this.bandPass1000Buffer);
for (var i = 0; i < 512; i++) { for (var i = 0; i < 512; i++) {
this.ByteToDecimal = (this.LevelBuffer[i]-128)/128; this.ByteToDecimal = (this.LevelBuffer[i]-128)/128;
@ -808,7 +779,6 @@ export default {
StartButtonPressed(){ StartButtonPressed(){
let constraints = { let constraints = {
@ -830,6 +800,7 @@ export default {
this.source = this.audioCtx.createMediaStreamSource(this.stream); this.source = this.audioCtx.createMediaStreamSource(this.stream);
this.source100=this.audioCtx.createBufferSource() this.source100=this.audioCtx.createBufferSource()
this.Gain1000=this.audioCtx.createGain(); this.Gain1000=this.audioCtx.createGain();
this.Gain1000.gain.setValueAtTime(0,this.audioCtx.currentTime);
this.compressorNode= this.audioCtx.createDynamicsCompressor(); this.compressorNode= this.audioCtx.createDynamicsCompressor();
@ -838,16 +809,17 @@ export default {
.then(arrayBuffer => this.audioCtx.decodeAudioData(arrayBuffer)) .then(arrayBuffer => this.audioCtx.decodeAudioData(arrayBuffer))
.then(audioBuffer => { .then(audioBuffer => {
// Set buffer on AudioBufferSourceNode // Set buffer on AudioBufferSourceNode
const sampleRate = this.audioCtx.sampleRate;
this.source100.buffer = audioBuffer; this.source100.buffer = audioBuffer;
this.source100.loop = true; this.source100.loop = true;
// Connect nodes // Connect nodes
// this.source100.connect(compressorNode); // this.source100.connect(compressorNode);
this.source100.connect(this.Gain1000); this.source100.connect(this.Gain1000);
// this.Gain1000.connect(this.compressorNode);
this.Gain1000.connect(this.audioCtx.destination); this.Gain1000.connect(this.audioCtx.destination);
// this.Gain1000.gain.setValueAtTime(1,this.audioCtx.currentTime); this.source100.start();
// Play source node
this.source100.start();
}); });
this.SoundNode=this.audioCtx.createBufferSource(); this.SoundNode=this.audioCtx.createBufferSource();
this.harmonicGainNode=this.audioCtx.createGain(); this.harmonicGainNode=this.audioCtx.createGain();

View File

@ -10,7 +10,7 @@
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-11 pt-md-4"> <div class="col-11 pt-md-4">
<form> <form>
<div class="row justify-content-center"> <div class="row justify-content-center ">
<div class="col-md-3 text-center"> <div class="col-md-3 text-center">
<h6 class="pb-0 mb-0">Input device:</h6> <h6 class="pb-0 mb-0">Input device:</h6>
<p class="pt-0 mt-0 text-muted pb-0 mb-0" style="font-size: 14px;font-weight: 500">(select laptop or mobile device microphone)</p> <p class="pt-0 mt-0 text-muted pb-0 mb-0" style="font-size: 14px;font-weight: 500">(select laptop or mobile device microphone)</p>
@ -31,8 +31,8 @@
</div> </div>
<div class="row justify-content-center pt-3"> <div class="row justify-content-center pt-3">
<div class="col-md-3 text-center"> <div class="col-md-3 text-center" style="z-index: 1000000;">
<button class="btn col-4 next-btn" >NEXT</button> <NuxtLink :to="localePath('onboarding')" style="z-index: 1000000" class="btn col-4 next-btn" >NEXT</NuxtLink>
</div> </div>
</div> </div>
</form> </form>
@ -78,7 +78,7 @@ export default {
console.log(data); console.log(data);
if(data.success){ if(data.success){
// this.$toast.success(data.message); // this.$toast.success(data.message);
this.$router.push(this.localePath('letsgo')); this.$router.push(this.localePath('onboarding'));
} }
}).catch((e)=>{ }).catch((e)=>{
this.$toast.error("something went wrong while saving..."); this.$toast.error("something went wrong while saving...");
@ -114,4 +114,4 @@ export default {
background: #e9c046; background: #e9c046;
color: white; color: white;
} }
</style> </style>

View File

@ -2,7 +2,7 @@ import axios, {AxiosInstance, AxiosRequestConfig} from "axios";
import {useUserStore} from '@/stores/user'; import {useUserStore} from '@/stores/user';
import {mapState} from 'pinia'; import {mapState} from 'pinia';
export default defineNuxtPlugin((nuxtApp) => { export default defineNuxtPlugin((nuxtApp) => {
const defaultUrl = "https://admin.mindboost.craveteck.com"; const defaultUrl = "https://admin.mindboost.craveteck.pk";
// const defaultUrl = "http://localhost:8000"; // const defaultUrl = "http://localhost:8000";
@ -32,4 +32,4 @@ export default defineNuxtPlugin((nuxtApp) => {
axios: api, axios: api,
}, },
}; };
}); });

BIN
public/.DS_Store vendored

Binary file not shown.

8720
yarn.lock

File diff suppressed because it is too large Load Diff