diff --git a/example/example.js b/example/example.js index 3807f54..7819c12 100644 --- a/example/example.js +++ b/example/example.js @@ -1,20 +1,18 @@ -const { AudioProcessor } = require('../index'); // Assuming your index.js is in the parent directory +const { getTranscription, getRedactedAudio } = require('..'); // Assuming your index.js is in the parent directory async function runExample() { const audioFilePath = '../audio/a.mp3'; - const outputFilePath = './redacted_audio.wav'; + const outputFilePath = './outs/redacted_audio.wav'; try { // Create a transcriber and a redactor from the factory - const transcriber = AudioProcessor.getTranscriber('deepgram',process.env.DEEPGRAM_API_KEY, audioFilePath); - const redactor = AudioProcessor.getRedactor('deepgram', audioFilePath); - - // Perform transcription - const transcription = await transcriber.processAudio(audioFilePath); + const transcription = await getTranscription('deepgram', + process.env.DEEPGRAM_API_KEY, + audioFilePath); console.log('Transcription completed:', transcription); // Perform redaction - await redactor.redactAudio(transcription.redactionTimestamps, audioFilePath, outputFilePath); + await getRedactedAudio('deepgram', transcription.redactionTimestamps, audioFilePath, outputFilePath); } catch (error) { console.error('Error processing audio:', error); }