File size: 587 Bytes
8ad2ab3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

from .sds import calc_sds

import logging
logger = logging.getLogger(__name__)

def main(file_path: str) -> dict:
    logger.info(f"Starting tone analysis for: {file_path}")
    try:

        
        results = calc_sds(file_path)

        # Structure response
        response = {
            "speech_dynamism_score" : round(results, 2),
        }
        logger.info("Tone analysis complete")
        return response

    except Exception as e:
        logger.error(f"Tone analysis failed internally: {e}", exc_info=True)
        raise RuntimeError(f"Error during analysis: {str(e)}")