Minnie Driver as Maya
“Speechless” star Minnie Driver tweeted that Season 2, episode 16 of the ABC comedy is the “happiest thing” she’s ever filmed. ABC/Richard Cartwright

Minnie Driver is showing off her singing chops in this week’s musical episode of “Speechless.”

In a sneak peek from Season 2, episode 16 of the ABC comedy, Maya (Driver) receives a letter notifying her that she has jury duty. The DiMeo matriarch pretends in front of her family that she’s bummed about having to go to court, but internally, she finds herself daydreaming about how she will spend the whole week doing nothing but jury duty.

Singing to the tune of “I’ve Got a Golden Ticket” from the 1971 musical fantasy film “Willy Wonka & the Chocolate Factory,” Maya dances her way to a courthouse and crows about all the perks that come with doing jury duty. When her elaborate sing-and-dance reverie ends, Maya snaps back to reality and puts on a sour face. “I guess I gotta do it,” she says with an exasperated sigh.

In a recent interview with Yahoo! Entertainment, Driver revealed that the musical concept of the episode was conceived and executed at the last minute. “The episode they were writing wasn’t working, and at a very late hour they cut the whole [thing],” the Oscar-nominated actress said. “It came — as a lot of great ideas do — at the 11th hour, and it just fit. It was very unexpected.”

Because the episode was conceived at the 11th hour, Driver didn’t have much time to rehearse her musical performance in the episode. “I learned each section [of the performance] 10 minutes before we shot,” she said, before admitting that although the sequence looks flawless from a layman’s point of view, it isn’t actually perfect. “I love to dance, and I see problems. I wish I’d had more rehearsal, because I could have executed my turns better!”

In a tweet, Driver wrote that the musical episode is the “happiest thing” she’s ever filmed.

But according to the synopsis for the episode, Maya’s fun jury duty takes an unexpected turn when she learns that Taylor’s (Sedona James) mom, Melanie (Sarah Chalke), is also there. In another sneak peek from the installment, Maya confronts Melanie in front of the judge and their fellow jurors.

Elsewhere in the episode, JJ ( Micah Fowler) lies about his disabilities on an online dating site after a few bad dates; and Ray (Mason Cook) is upset that Jimmy (John Ross Bowie) and Dylan (Kyla Kenedy) spend too much together.

“Speechless” Season 2, episode 16, titled “A-N-- ANGRY M--MAYA,” airs on Wednesday, March 14 at 8 p.m. EDT on ABC.