Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const record = () => {
let recordingsPath = userSettings.get('recordingsPath');
if (!recording) {
let freqText = require('../fmRadio.js').getFreqText();
fileWriter = new flac.FileEncoder({
samplerate: 48000, bitsPerSample: 16, compressionLevel: 6, file: path.join(recordingsPath, freqText.replace(' ', '') + '_' + getDateStr() + '_recording.flac')
});
recording = true;
} else {
stopRecording();
}
};