From c25b3b0293563b4819b9626ae4e1278e77465d0b Mon Sep 17 00:00:00 2001 From: Waqar Ul Zafar Date: Mon, 12 Jun 2023 00:20:39 +0500 Subject: [PATCH] ok --- .DS_Store | Bin 10244 -> 10244 bytes assets/bandpass-processor.js | 67 ++ components/BootomBar.vue | 40 +- components/homebar.vue | 19 +- layouts/default.vue | 40 +- nuxt.config.ts | 1 - pages/adaptivesoundscap.vue | 100 --- pages/auth/login.vue | 3 +- pages/auth/signup.vue | 1 + pages/band.vue | 211 ++++- pages/band2.vue | 224 ++++++ pages/band3.vue | 66 ++ pages/band_target.vue | 1086 ++++++++++++++++++++++++++ pages/homeforest.vue | 44 +- pages/homemeadow.vue | 46 +- pages/hometropics.vue | 47 +- pages/index.vue | 47 +- pages/letsgo.vue | 1 + pages/onboarding.vue | 88 ++- pages/onboarding/index.vue | 15 +- pages/onboarding/onboarding2.vue | 19 +- pages/onboarding/onboarding3.vue | 20 +- pages/onboarding/onboarding4.vue | 14 +- pages/setting/soundscap.vue | 2 +- pages/setting/subscription.vue | 6 +- plugins/toastr.client.ts | 5 +- public/.DS_Store | Bin 8196 -> 10244 bytes public/MaskingNoise_63.aac | Bin 0 -> 1888224 bytes public/images/poster.png | Bin 0 -> 6299505 bytes public/masking/MaskingNoise_1000.aac | Bin 0 -> 1888224 bytes yarn.lock | 11 +- 31 files changed, 2006 insertions(+), 217 deletions(-) create mode 100644 assets/bandpass-processor.js delete mode 100755 pages/adaptivesoundscap.vue create mode 100644 pages/band2.vue create mode 100644 pages/band3.vue create mode 100644 pages/band_target.vue create mode 100644 public/MaskingNoise_63.aac create mode 100644 public/images/poster.png create mode 100644 public/masking/MaskingNoise_1000.aac diff --git a/.DS_Store b/.DS_Store index 37ebb873636a88aeab32fc1975fa6fbe91267c82..20a85da4490acc7dff414c6bba0efe66f48ee49c 100755 GIT binary patch delta 111 zcmZn(XbIR5FFtv?XeqmqvAK?dk>%uD;xd!<#Z)FsNmw(9iB1lesFaNt;4e-t%FoFO z$S=+;$;{7-j7~4gOz}@kD^4w${8nNDlX=7BdP!}@^_y2qMzd{ZSBPN8VkR#D?JFbf delta 134 zcmZn(XbIR5FV47qa)Njvr+9U>k&%vqvBl)u;xde#lMTe=8M`J+NZ2unicOA?sFaOP zFUm~uPfIIKEs2a5;4e-t%FoFO$S=+;$;{82{7zy5lM2J+21#wkm7CW{Mzd{ZQ;1~8 OW;S0Z0~jzef++w$p(e`! diff --git a/assets/bandpass-processor.js b/assets/bandpass-processor.js new file mode 100644 index 0000000..63cc059 --- /dev/null +++ b/assets/bandpass-processor.js @@ -0,0 +1,67 @@ +class BandpassProcessor extends AudioWorkletProcessor { + process(inputs, outputs, parameters) { + const input = inputs[0]; + const output = outputs[0]; + const frequency = parameters.frequency; + const Q = parameters.Q; + + for (let channel = 0; channel < input.length; channel++) { + const inputChannel = input[channel]; + const outputChannel = output[channel]; + + for (let i = 0; i < inputChannel.length; i++) { + // Apply bandpass filter to inputChannel[i] and store the result in outputChannel[i] + // using the provided frequency and Q parameters + } + } + + // Calculate the RMS value of the output audio data + const rms = this.calculateRMS(output); + + // Calculate the dB values + const dbValues = this.convertToDB(output); + + // Calculate the 10th and 90th percentile values + const percentile10 = this.calculatePercentile(dbValues, 10); + const percentile90 = this.calculatePercentile(dbValues, 90); + + // Send the processed data to the main thread + this.port.postMessage({ rms, dbValues, percentile10, percentile90 }); + + return true; + } + + calculateRMS(data) { + let sumOfSquares = 0; + for (let channel = 0; channel < data.length; channel++) { + const channelData = data[channel]; + for (let i = 0; i < channelData.length; i++) { + sumOfSquares += channelData[i] * channelData[i]; + } + } + const meanSquare = sumOfSquares / (data.length * data[0].length); + const rms = Math.sqrt(meanSquare); + return rms; + } + + calculatePercentile(data, percentile) { + const sortedData = data.slice().sort((a, b) => a - b); + const index = Math.floor((percentile / 100) * sortedData.length); + return sortedData[index]; + } + + convertToDB(data) { + const dbValues = []; + for (let channel = 0; channel < data.length; channel++) { + const channelData = data[channel]; + for (let i = 0; i < channelData.length; i++) { + const amplitude = Math.abs(channelData[i]); + const db = 20 * Math.log10(amplitude + this.minAmplitude); + dbValues.push(db); + } + } + return dbValues; + } +} + +export default registerProcessor('bandpass-processor', BandpassProcessor); \ No newline at end of file diff --git a/components/BootomBar.vue b/components/BootomBar.vue index 3638e46..b42a7f2 100644 --- a/components/BootomBar.vue +++ b/components/BootomBar.vue @@ -18,15 +18,15 @@ @@ -41,7 +41,7 @@

-

@@ -54,7 +54,7 @@ @@ -68,7 +68,7 @@

-

@@ -81,7 +81,7 @@ @@ -94,14 +94,14 @@