Let’s get the obvious out of the way first — Florence Foster Jenkins sang, but it wasn’t pretty.

The wealthy socialite, who gave recitals in New York for her upper-crusty pals in the 1920s, ’30s and ’40s, was filled with the joy of music. But what came out of her mouth sounded more akin to, oh, screeching tires, or perhaps a duck being strangled. Violently.

“Some may say that I couldn’t sing, but no one can say that I didn’t sing” is how Lady Florence, as she liked to be called, is said to have put it.

Fast forward several decades, and her legend lives on, thanks to YouTube clips of her warbly recordings, and now a new feature film starring none other than Meryl Streep.

“Florence Foster Jenkins,” directed by Stephen Frears, hits theaters Aug. 12. The film chronicles the buildup to her most notorious performance — at Carnegie Hall in 1944 — as her loving partner (Hugh Grant) and stalwart pianist (Simon Helberg of “The Big Bang Theory”) fret over the reaction they expect she’ll get from a general audience rather than her, um, indulgent friends. Along the way, secrets from her past are revealed, and music is played — for real (Helberg on piano, Streep on vocals).

“It was not how bad she was, but . . . how . . . cloooose she caaaame to getting the note,” Streep said in a recent interview on CBS’ “Sunday Morning.” “You were with her all the way.”

advertisement | advertise on newsday

For Streep, the challenge was not just to sing, but sing badly — well. It’s not as easy as it looks.

PRACTICE MAKES IM-PERFECT

As a girl, Streep loved singing. She even trained with Beverly Sills’ vocal coach, Estelle Liebling. “I had a very good coloratura voice,” she said in a 2012 NPR interview. “But it’s a voice I don’t have anymore.”

Enter Arthur Levy, a professor at the Mannes College of Music and coach to a slew of operatic and Broadway legends, including six-time Tony winner Audra McDonald, who recommended Levy to Streep.

“She hadn’t sung . . . into the extremes for decades,” says Levy, sitting in his voice studio, a modest space a few blocks from Carnegie Hall. “So we had to reboot what she’d learned years ago.”

Streep, renowned for her finesse with accents and imitations of women like Margaret Thatcher and Julia Child, had her work cut out for her with Lady Florence, who’d sung demanding arias like the “Queen of the Night” from Mozart’s “The Magic Flute,” or “Adele’s Laughing Song” from Johann Strauss’ “Die Fledermaus.”

“These arias are no joke,” says Levy, “even if you’re singing off-key — especially off-key, which strains the voice.”

There was nothing glamorous in the work. Streep came to Levy twice a week for four months last year, standing in his studio, with its upright piano, a couple of chairs, a music stand. She sang scales and arpeggios, up and down, up and down, and focused on posture, diction, breathing. She learned all the music correctly, and “her intonation was dead-on,” Levy recalls.

advertisement | advertise on newsday

One day, she vocalized up to a high E (aka pretty darn high). She winced at the sound, and they laughed. “I said, ‘Meryl, that’s still light-years better than the best Florence Foster Jenkins.’ ”

Once she had the music down, they set about Florence-ing it up. Rather than mimic the old recordings, Streep wanted to sing badly in her own way, so it came from the heart.

As with everything, Levy adds, she was precise — they “road-mapped” where she’d go flat, where words got garbled, where trills worked and “where they sounded like a flying saucer coming in from Mars.”

HE’S THE PIANO MAN

Streep arrived in England, where the film was shot last year, equipped with a warm-up recording from Levy, and prepared to record the songs with fellow actor Helberg at the piano. She assumed she’d then lip-sync the songs when shooting actual scenes, but director Frears had a different idea — he wanted them to perform live.

advertisement | advertise on newsday

“So there was a lot of pressure,” says Helberg, who started playing piano at age 10.

When cast as pianist Cosmé McMoon, he rented an apartment — “I have a noisy house, with kids running around” — where he could practice. And practice. It wasn’t just the playing, but acting while playing, that added to the challenge.

Once in England, he and Streep rehearsed on weekends or any chance they got.

“It was unusual to see someone so accomplished still put in that much time and energy,” he says.

As for her hoots and howls?

“We laughed a lot,” Helberg admits, though he tried his best to keep his cool on set. “I felt a responsibility to be the anchor. I didn’t want to screw her up. We had a lot of music to get through.”

A WOMAN AHEAD OF HER TIME

The music is what Lady Florence lived for, though it seems she was born 100 years too soon. Today, amateur singers, stylists, gladiators — amateur anythings — are hailed on all forms of social media. She’d be a reality-show sensation.

But what distinguishes her brazen showmanship from today’s self-promoters is the motivation. She sang not for fame but for the sheer love of music-making. Lady Florence wanted to share, not take.

Listening to the old recordings, Levy says, he can’t help but feel love and affection for the outlandish operatic wannabe. “To me, the movie is about how music can be a beautiful healing thing. I think Florence really felt a sense of responsibility to bring beauty into the world at a dark time.”

She did it through singing. Albeit bad — very bad — singing.

“Now she’s a legend because of it,” he says, shrugging. “So . . . how bad is that?”