LuisMayo / objection_engine

Library that turns comment chains into ace attorney scenes, used in several bots
MIT License
105 stars 20 forks source link

objection sound effect lags #65

Closed wanghaisheng closed 2 years ago

wanghaisheng commented 2 years ago
    for obj in sound_effects:
        if obj["_type"] == "silence":
            audio_se += AudioSegment.silent(duration=int(obj["length"] * spf))
        elif obj["_type"] == "bip":
            index=0
            ttsfile  = ttsmp3_polly_tts(obj["text"],obj["character"],'tts-tmp',index)
            audio_se += blink + AudioSegment.from_mp3(ttsfile)
            index =index +1
            # audio_se += blink + long_bip[: max(int(obj["length"] * spf - len(blink)), 0)]

when I try to use a long script ,final video is lagged due to objection effect and i did not get where cause this result g047KD3aQA2XAuB7Qn-6RA_comments.zip

comments = [
Comment(user_name = 'fowlraul', text_content='Its also absurd, disgusting, treasonous, dumb, stupid, lame, and totally not a surprise at all'),
Comment(user_name = 'coldstreamer59', text_content='Trump is a narcissistic traitor, a psycho'),
Comment(user_name = 'straygoat193', text_content='You are right Bernie He is a sick man and is using an international crisis to get the attention he so misses'),
Comment(user_name = 'newNull', text_content='Americans in name only Fuck the GOP!'),
Comment(user_name = 'wish1977', text_content='At a time when the country should be rallying around our president, Donald Trump seems to be rallying around his president or should I say dictator'),
Comment(user_name = 'dartie', text_content='Trump deserves prison'),
Comment(user_name = 'PURPLEPEE', text_content='Fuck Trump and Putin'),
Comment(user_name = 'cgilbertmc', text_content='and typical')]