File size: 658 Bytes
243586b
 
 
 
 
 
 
68b5237
243586b
 
068665b
 
 
 
243586b
60dbb29
243586b
 
da622d4
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from translation import get_transcription_from_sound
from gemini_call import ask_gemini
from dotenv import load_dotenv

load_dotenv()

def get_analysis(file_path)->str:
    """Makes the pipeline to perform the sentiment analysis on a .wav file"""
    transcript = get_transcription_from_sound(file_path)
    
    if len(transcript) > 0:
        analysis = ask_gemini(transcript)
    else :
        analysis = "Did not provide any message in order to be analysed"
    
    return transcript , analysis

if __name__ == "__main__":
    file_path = "recorded_audio.wav"
    transcript , analysis = get_analysis(file_path)
    print(f'Analysis result {analysis}')