Skip to content

Commit

Permalink
fix record all call does not work on wav format (#211)
Browse files Browse the repository at this point in the history
* fix #210

* fix throw error without new

* fix throw error without new
  • Loading branch information
xquanluu authored Aug 1, 2023
1 parent f3d002c commit d361f1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/record/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async function upload(logger, socket) {

/**encoder */
let encoder;
if (obj.record_format === 'wav') {
if (account[0].record_format === 'wav') {
encoder = new wav.Writer({ channels: 2, sampleRate, bitDepth: 16 });
} else {
// default is mp3
Expand Down
4 changes: 2 additions & 2 deletions lib/routes/api/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,15 +556,15 @@ function encryptBucketCredential(obj) {
obj.bucket_credential = encrypt(awsData);
break;
case 'google':
assert(service_key, 'invalid aws S3 bucket credential: service_key is required');
assert(service_key, 'invalid google cloud storage credential: service_key is required');
const googleData = JSON.stringify({vendor, name, service_key, tags});
obj.bucket_credential = encrypt(googleData);
break;
case 'none':
obj.bucket_credential = null;
break;
default:
throw DbErrorBadRequest(`unknow storage vendor: ${vendor}`);
throw new DbErrorBadRequest(`unknow storage vendor: ${vendor}`);
}
}

Expand Down

0 comments on commit d361f1a

Please sign in to comment.