mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2025-12-19 05:47:46 +00:00
fix record all call does not work on wav format (#211)
* fix #210 * fix throw error without new * fix throw error without new
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -556,7 +556,7 @@ 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;
|
||||
@@ -564,7 +564,7 @@ function encryptBucketCredential(obj) {
|
||||
obj.bucket_credential = null;
|
||||
break;
|
||||
default:
|
||||
throw DbErrorBadRequest(`unknow storage vendor: ${vendor}`);
|
||||
throw new DbErrorBadRequest(`unknow storage vendor: ${vendor}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user