diff --git a/index.js b/index.js index f000044..978d957 100644 --- a/index.js +++ b/index.js @@ -17,7 +17,7 @@ class Recording { silence: '1.0', recorder: 'sox', endOnSilence: false, - audioType: 'wav' + audioType: 'waveaudio' } this.options = Object.assign(defaults, options) diff --git a/recorders/sox.js b/recorders/sox.js index 8ebfe2b..97daf2d 100644 --- a/recorders/sox.js +++ b/recorders/sox.js @@ -2,14 +2,14 @@ module.exports = (options) => { const cmd = 'sox' let args = [ + '--type', options.audioType, // audio type '--default-device', '--no-show-progress', // show no progress '--rate', options.sampleRate, // sample rate '--channels', options.channels, // channels '--encoding', 'signed-integer', // sample encoding '--bits', '16', // precision (bits) - '--type', options.audioType, // audio type - '-' // pipe + '-p' // pipe ] if (options.endOnSilence) {