How do I make these all apply to one function, so that one plays, but stops the one before it?

Code

    def rex_audio(self):
            RexAud = SoundLoader.load('Rex.wav')
            RexAud.play()
            return

    def sweetie_audio(self):
        SweetieAud = SoundLoader.load('Sweetie.wav')
        SweetieAud.play()
        return

2 Replies 2

Your question isn’t clear. What exactly do you want the function to do, and what does ‘stop the one before it’ mean? Also show how you’re calling these functions. Without that, it’s hard to give a useful answer.

Why the extraneous return at the end of each function?

Your Reply

By clicking “Post Your Reply”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.