The combination of ConvertAPI, OpenAI, ElevenLabs and FFmpeg modules enables a multi-step transformation of a PDF into an audio dialogue. Initially, the ConvertAPI module is used to transform the PDF content into text. This extracted text, now in a readable and editable format, serves as the base material for the next steps.
With the text extracted, it is then processed through the AI Interpolator OpenAI module, which transforms the content into a dialogue format. OpenAI structures the text into an interactive conversation, making it more engaging and dynamic.
The newly created dialogue is then fed into the ElevenLabs field module. ElevenLabs converts the dialogue into an audio file, providing an audio version of the conversation. However, to refine and finalize the audio file, it is then processed through FFmpeg. This additional step makes sure the audio quality is optimized and the file is in the desired audio format, ready for listening. The end result is an accessible, audible conversation made from the original PDF content.
This video is from before the AI Interpolator module became AI Automators, part of the AI module . Module and menu names have changed since, and some steps look different today.
0:00
hey there uh Marcus here uh today we're going to do a workflow that's pretty complex so what we're going to do is we're going to upload a PDF uh this one about uh fixing the
0:12
computer guy posture something every developer should read by the way uh and we're going to uh generate a dialogue about it in uh actual people talking right about it and not just one person
0:28
saying the text in here but we're actually going to create a dialogue where they are discussing it um as always this is Drupal Drupal is open source uh I have installed AI
0:40
interpolator modules otherwise it's completely vanilla what I have running on here as well on this lamp service FFM Peg and this is a requirement for one of the steps that I'm going to show now uh
0:52
so this is a little bit more complex but you're still not going to need any coding to set this up everything is open source uh free to use free to create products out of if you want
1:05
um yeah if you find bugs please let me know so we start by logging in uh and then we uh create a content type we're going to create that content type called the
1:21
dialogue um so this is a typical workflow for the CMS part of uh Drupal that's more Drupal is a Content management framework you don't necessarily need to use it for uh as a
1:33
Content management system that's why it was very good to actually create the AI interpolator so the whole idea of chaining fields to Fields because Drupal is very powerful when it comes to
1:46
this uh so I am using nodes now to be able to show the GUI part of it if you ever create a product make sure that you create it in uh uh like a a custom entity type also so you know you can
1:58
create this using a API so if you don't like Drupal you can set up the chaining here but then you can have a API call to upload the PDF and API call to download
2:09
the MP3 basically we're going to remove the body field because that's a typical CMS field we don't need but a field we do need is a file field because we need to upload a PDF right that's where
2:23
everything starts it's just going to be one file we need to require it because without it we can't do anything and it should be a PDF uh the next step is that we need to
2:36
scrape this PDF and get text from it so we have something to feed OpenAI to create a dialogue should just be one as well we can do full HTML and here we enable the AI interpolator then use the
2:49
rule text from document so that takes u a document and creates text from it we use the base mode and the PDF file uh turn on batch mode so we can see that the progress uh Next Step then is
3:06
uh uh let me think we need to create ElevenLabs field so that's the dialogue dialog oh I had it therea um and this has to be unlimited because that's uh for each person speaking it
3:24
will create one field right so if we want them to speak back and forth you have to have well you don't have to have unlimited but you can't have one field at least and we enable the AI
3:34
interpolator use the 11 lab styo Creator rule base mode we're going to use the PDF text as the context and I'm just going to inspect here and steal that um steal that
3:47
placeholder because it's pretty good oh we don't need the HTML though right so we just remove here so we're going to have the interviewer mark Johansson so that's
4:02
me uh be very aware though that my learned voice is not super great I sound Dutch for whatever reason so uh I should spend more time actually teaching the voice but it's
4:15
just so so you see that you can actually uh use your own voices as well in this so ElevenLabs uh allows you to upload MP3 file of you talking and it creates your voice from this so we're going to do
4:28
this this based on context create a dialogue between podcast interviewer well it doesn't need to be a podcast right but whatever who is the fun loving character and UL typ who is a serious
4:39
guest expert on the topic so she's going to know everything about this document then is the idea uh start with introduction and create oh create I'm just going to do
4:51
three dialogues back and forth because this takes for really takes a long time first of all for OpenAI to create the dialogue but ElevenLabs I should create the audio and then the ElevenLabs voices to you
5:05
so we have Marcus Johansson here instead right um and in the placeholders you can find all the voices so there is you can see here there is a Marcus Johansson instead and for Julia stes we can take
5:21
Susan so that's American J girl voice I think context is the context so that's the PDF text right uh we have to set the interpolator way higher because otherwise of course
5:34
uh we run into uh we can run into the text not existing before we have to create this batch mode GPT-4 creates better stuff save then we're going to do one more thing and create another field because
5:54
the thing is the ElevenLabs field it will create One MP3 per d I mean per person saying something and that we can't use if we just want to provide One MP3 for everyone so you can play that on the
6:07
website but if you're using it for a process where you don't actually want the website to be the end station right um then you might want to mix this so we just create a file field called
6:27
audio should just have one field MP3 save this and if we go back to dialogue now then there was a option that you saw before maybe if you looked quickly there is resaving audio field we
6:42
say this and we say conen it so we're going to take all this dialogues and just create One MP3 you can see we can have intros outros soundscapes and mix it as well but we don't do that
6:56
now save this and we're going to create the content so we call this back back pan upload the file uh this one stretches PDF and this is going to fill out everything and and
7:13
in the end hopefully create the audio then and now this is going to take some time so the first process of uh generating text from PDF that's very fast but the second one where we're
7:24
actually asking OpenAI to create the dialogue and then you're writing all the MP3 and then well the last part of concatenating that's very quick because it's audio video can take some time but
7:37
audio is very very quick um so this yeah it will take some time um I can say while we're waiting I'm probably going to uh set up some uh images in DigitalOcean or Amazon
8:00
where you can actually copy this image to get uh a like a a Drupal profile that has all the AI interpolator and everything installed so you it's just going to be one click set up and if I
8:15
ever have the time to do this I will make sure that FFmpeg is installed so you can use this part as well there will probably be AI interpolators for video in the future where anyway it makes a
8:28
lot of sense to have have FFmpeg install because it's extremely powerful tool when it comes to Media so now it's finished so we have the PDF we have the text from the
8:39
PDF we have a virtual player that we could play but that is basically playing One MP3 after the other but it has created MP3 here as well so now we're going to listen to this so the next
8:51
audio you hear now and you're going to hear it's not really me but it's not going to be me talking but the virtually hello and welcome to the show Julia how are you doing today thank you Marcus I'm
9:03
doing well ready to tackle the issues related to posture and lower backage hip stability excellent it's it's such a common problem so tell me Julia why is it a mistake for people to think that
9:16
working out hard in the gym will fix their bad posture well Marcus the gym only cements what you have if you have the bad posture heavy lifting can actually make it worse if you have good
9:27
posture heavy lifting can enhance it but of course there are exceptions interesting and what about the common posture dysfunction the anterior pelvic tilt how can we recognize and correct
9:41
this issue you can check by looking at your belt or from a side profile in the mirror if it's tilted down or your butt sticking out chances are you have it correcting it involves several steps
9:52
from lengthening the hip flexors strengthening glutes and finally lower back stretching and strengthening abs I see that's enlightening um thank you so much for your insights today
10:05
Julia yeah as you can hear my voice is not that great so you can use two professional voice actors and it's going to be very much better result or train on a voice actor's voice
10:17
then uh but that's it uh we have a audio file from a PDF uh of people talking about the PDFs um yeah thank you for watching