Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
// const fs = require('fs');
// const DEEPGRAM_API_KEY = 'd91846eef2b4c8fbda7a1cf77402beeb10a1f9f1';
// const PATH_TO_FILE = '/home/admin1/Documents/Tikva/downloaded_files/phone_20230630-130414__19178076389.amr';
// const DEEPGRAM_API_URL = 'https://api.deepgram.com/v1/listen';
// async function deepgramSpeechToText(path) {
// try {
// // Read the audio file as a buffer
// const audioBuffer = fs.readFileSync(path);
// console.log("**************************88")
// // Set headers including the Deepgram API key
// const headers = {
// Authorization: `Bearer ${DEEPGRAM_API_KEY}`,
// 'mimetype': 'audio/amr', // Replace with the appropriate content type
// };
// console.log("####################3")
// // Send the audio data to Deepgram for transcription
// const response = await axios.post(DEEPGRAM_API_URL, headers:headers);
// console.log("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&")
// // Process the transcription result
// const transcript = response.data.results[0].channels[0].alternatives[0].transcript;
// console.log(transcript);
// return transcript;
// } catch (error) {
// console.error('Error:', error.message);
// return null;
// }
// }
// deepgramSpeechToText(PATH_TO_FILE);
const axios = require('axios');
// Set your Deepgram API credentials
const apiKey = 'd91846eef2b4c8fbda7a1cf77402beeb10a1f9f1';
// Deepgram API endpoint
const apiUrl = 'https://api.deepgram.com/v1/listen';
// Function to send an audio file for transcription
async function transcribeAudio(audioFile) {
try {
const response = await axios.get(apiUrl, audioFile, {
headers: {
'Content-Type': 'audio/amr', // Modify the content type if needed
Authorization: `Bearer ${apiKey}`,
},
});
// Process the response data
console.log('Transcription Response:', response.data);
// You can handle the transcription response here
// For example, you may want to save the transcription or perform further processing.
} catch (error) {
console.error('Error transcribing audio:', error.message);
}
}
// Example usage
const audioFile = '/home/admin1/node_demo/downloaded_files1/phone_20230630-130414__19178076389.amr'; // Replace with your audio file data (e.g., Buffer or base64 encoded)
transcribeAudio(audioFile);
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team