Skip to content

Commit

Permalink
Merge pull request #54 from ajinkyapandetekdi/all-0.5-latest
Browse files Browse the repository at this point in the history
contentsessionId issue fixed issue #204095 feat Capturing Audio Clip in Telemetry
  • Loading branch information
gouravmore authored Aug 29, 2023
2 parents 0000bdf + 6b4a98f commit d68b0a6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/components/AudioRecorderTamil/AudioRecorderTamil.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ function Mic({

if (process.env.REACT_APP_CAPTURE_AUDIO === 'true') {
let getContentId = parseInt(localStorage.getItem('content_random_id')) + 1;
var audioFileName = `${process.env.REACT_APP_CHANNEL}/${localStorage.getItem('contentSessionId')}-${Date.now()}-${getContentId}.wav`;
var audioFileName = `${process.env.REACT_APP_CHANNEL}/${localStorage.getItem('contentSessionId')===null? localStorage.getItem('allAppContentSessionId'):localStorage.getItem('contentSessionId')}-${Date.now()}-${getContentId}.wav`;

const command = new PutObjectCommand({
Bucket: process.env.REACT_APP_AWS_s3_BUCKET_NAME,
Expand All @@ -232,7 +232,6 @@ function Mic({

try {
const response = await S3Client.send(command);
console.log(`${process.env.REACT_APP_AWS_s3_BUCKET_URL}/${audioFileName}`);
} catch (err) {
console.error(err);
}
Expand Down
5 changes: 2 additions & 3 deletions src/components/VoiceCompair/VoiceCompair.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ const VoiceCompair = props => {
);
}

let word_result = (result_per_words == 100) ? "correct" : "incorrect";
let word_result = (result_per_words === 100) ? "correct" : "incorrect";

if (process.env.REACT_APP_CAPTURE_AUDIO === 'true') {
let getContentId = parseInt(localStorage.getItem('content_random_id')) + 1;
var audioFileName = `${process.env.REACT_APP_CHANNEL}/${localStorage.getItem('contentSessionId')}-${Date.now()}-${getContentId}.wav`;
var audioFileName = `${process.env.REACT_APP_CHANNEL}/${localStorage.getItem('contentSessionId')===null? localStorage.getItem('allAppContentSessionId'):localStorage.getItem('contentSessionId')}-${Date.now()}-${getContentId}.wav`;

const command = new PutObjectCommand({
Bucket: process.env.REACT_APP_AWS_s3_BUCKET_NAME,
Expand All @@ -229,7 +229,6 @@ const VoiceCompair = props => {
try {
const response = await S3Client.send(command);
console.log(response);
console.log(`${process.env.REACT_APP_AWS_s3_BUCKET_URL}/${audioFileName}`);
} catch (err) {
console.error(err);
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/telementryService.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (localStorage.getItem('contentSessionId') !== null) {
contentSessionId = localStorage.getItem('contentSessionId');
} else {
contentSessionId = uniqueId();
localStorage.setItem('contentSessionId', contentSessionId);
localStorage.setItem('allAppContentSessionId', contentSessionId);
}

let getUrl = window.location.href;
Expand Down

0 comments on commit d68b0a6

Please sign in to comment.