audioSentiment / config.py
temp12821's picture
working prototype of the audio processing module
feaf7eb
import os
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
class Config:
"""Application configuration loaded from environment variables"""
# Model Settings
MODEL_NAME = os.getenv('MODEL_NAME', 'superb/wav2vec2-large-superb-er')
# Audio Processing Settings
CHUNK_DURATION = int(os.getenv('CHUNK_DURATION', 3)) # seconds
SAMPLE_RATE = int(os.getenv('SAMPLE_RATE', 16000)) # Hz
# Emotions
EMOTIONS = os.getenv('EMOTIONS', 'Happy,Sad,Angry,Neutral').split(',')
# Flask API Settings
FLASK_HOST = os.getenv('FLASK_HOST', '0.0.0.0')
FLASK_PORT = int(os.getenv('FLASK_PORT', 5000))
FLASK_DEBUG = os.getenv('FLASK_DEBUG', 'True').lower() == 'true'
# Emotion Emoji Mapping
EMOTION_EMOJI_MAP = {
'Happy': '😊',
'Sad': '😢',
'Angry': '😡',
'Neutral': '😐',
'Fear': '😨',
'Surprise': '😲',
'Disgust': '🤢'
}
# Emotion Color Mapping (for charts)
EMOTION_COLOR_MAP = {
'Happy': '#FFD700',
'Sad': '#4169E1',
'Angry': '#DC143C',
'Neutral': '#808080',
'Fear': '#9370DB',
'Surprise': '#FF8C00',
'Disgust': '#32CD32'
}
# Create a config instance
config = Config()