Skip to content

A Chat with GPT: Poem Recorder

Could the great writers of the past have preferred to speak into a microphone or film their works instead of writing them down?
Attachments/A Chat with GPT - Poem Recorder 1.png
A Chat with GPT - Poem Recorder 2.png
A Chat with GPT - Poem Recorder 3.png
A Chat with GPT - Poem Recorder 4.png
A Chat with GPT - Poem Recorder 5.png
A Chat with GPT - Poem Recorder 6.png
A Chat with GPT - Poem Recorder 7.png is a reader-supported published Zettelkasten. Both free and paid subscriptions are available. If you want to support my work, the best way is by taking out a paid subscription.
A Chat with GPT - Poem Recorder 8.png
A Chat with GPT - Poem Recorder 9.png
A Chat with GPT - Poem Recorder 10.png
A Chat with GPT - Poem Recorder 11.png


const mic = require('mic');
const fs = require('fs');

const micInstance = mic({
    rate: '16000',
    channels: '1',
    debug: true,

const micInputStream = micInstance.getAudioStream();
const outputFileStream = fs.WriteStream('output.raw');


console.log('Recording started. Press Ctrl+C to stop.');


// Excerpt from Homer's "The Iliad"
const transcript = [
    'Sing, O goddess, the anger of Achilles son of Peleus,',
    'that brought countless ills upon the Achaeans.',
    'Many a brave soul did it send hurrying down to Hades,',
    'and many a hero did it yield a prey to dogs and vultures,',
    'for so were the counsels of Jove fulfilled from the day on',
    'which the son of Atreus, king of men, and great Achilles,',
    'first fell out with one another.'

let currentLine = 0;
const interval = setInterval(() => {
    if (currentLine < transcript.length) {
    } else {
}, 5000); // Scroll every 5 seconds

// micInputStream.on('data', function(data) {
//     console.log("Recieved Input Stream: " + data.length);
// });
micInputStream.on('error', function(err) {
    cosole.log("Error in Input Stream: " + err);
micInputStream.on('startComplete', function() {
    console.log("Got SIGNAL startComplete");
    setTimeout(function() {
    }, 5000);
micInputStream.on('stopComplete', function() {
    console.log("Got SIGNAL stopComplete");
micInputStream.on('pauseComplete', function() {
    console.log("Got SIGNAL pauseComplete");
    setTimeout(function() {
    }, 5000);
micInputStream.on('resumeComplete', function() {
    console.log("Got SIGNAL resumeComplete");
    setTimeout(function() {
    }, 5000);
micInputStream.on('silence', function() {
    console.log("Got SIGNAL silence");
micInputStream.on('processExitComplete', function() {
    console.log("Got SIGNAL processExitComplete");

process.on('SIGINT', () => {
    console.log('Recording stopped.');

// to play the audio file, run the following command (macOS):
// $ play -b 16 -e signed -c 1 -r 16000 output.raw

It works!
A Chat with GPT - Poem Recorder result.png