Replies: 1 (Who?), Viewed: 386 times.
Test Subject
Original Poster
#1 Old 26th Jul 2020 at 11:33 PM
Default Getting access to TuningPlayAudio
Hey has anyone had any luck playing audio via play_tunable_audio function from the file?
I have been trying to do that for a custom audio mod.

I tried to copy this into my script, but unfortunately I couldn't get the bills_paid_sfx to load because my script couldn't run the TunablePlayAudio constructor properly for some reason.

This is what the assignment for AUDIO looks like in the file (where I am trying to copy it from:
AUDIO = TunableTuple(description='Tuning for all the audio stings that will play as a part of bills.',
                                                  delinquency_warning_sfx=TunablePlayAudio(description='The sound to play when a delinquency warning is displayed. ')

Audio is a tuple that seems to contain other Objects.
So I tried to do something like:

after copying the code for AUDIO tuple initialization from but the code couldn't find delinquency_warning_sfx. I am guessing that it somehow gets injected dynamically based on some tuning file for that file ( but not for my mod.
Does anyone know where I can look at to figure this out?
Lab Assistant
#2 Old 7th Aug 2020 at 7:15 AM
AUDIO is an attribute of the Bills class.
You'll need to reference AUDIO like this: Bills.AUDIO
This code will play the sound.

from audio.primitive import play_tunable_audio
from sims.bills import Bills
Back to top