When Joe Wilder was traveling with a band in 1949 and playing trumpet at a club in Chicago, his solos were disrupted by college kids shouting racial slurs.

In his low-key style, the dapper Wilder put them in their place: “I know you probably don’t understand just how offensive this is,” said Wilder, who was among the first African-Americans to serve in the Marines during World War II. “At some point, you’re going to say something like that in the wrong place, and you’ll end up getting yourselves hurt.”

The show went on, uninterrupted.

Wilder, a consummate jazz musician who never saw himself as a civil rights activist but who helped break color barriers in orchestras at Broadway shows and in network studios, died May 9 in a New York City care facility. He was 92.

His death was confirmed by his daughter Elin Wilder-Melcher.

Equipped with a sly wit that showed up in his playing as well as in his chronic punning, Wilder had a vast range of musical talents.

Wilder toured with Lionel Hampton, Count Basie, Jimmie Lunceford and Benny Goodman. He backed up Billie Holiday and traded riffs with Dizzy Gillespie. Classically trained, he sat in with the New York Philharmonic. As an ABC studio musician in New York, he was a constant presence on “The Dick Cavett Show.” As a Broadway regular, he was in the pit orchestra of the musical “42nd Street” for more than eight years.

The breadth of his gigs was breathtaking. He played in beer commercials and in the orchestra at 22 Miss America pageants. His trumpet sounded in Army Staff Sgt. Barry Sadler’s Vietnam ode, “Ballad of the Green Berets,” and he was part of the Coffee Club Orchestra on Garrison Keillor’s “A Prairie Home Companion.” In his later years, he taught at the Juilliard School of Music.

A non-smoker and non-drinker, Wilder never made a public appearance without a jacket and tie. While he spent years on the road with various bands, he was not known to utter an obscenity. More than once, fellow musicians bet they could prompt one from him. They lost.

Even confronting blatant discrimination as a black musician, Wilder remained, on the surface, unflappable. “Everything that Joe went through isn’t readily apparent because he’s always so dignified and positive,” trumpet virtuoso Wynton Marsalis wrote in a foreword to “Softly, With Feeling,” a Wilder biography released in April.

On the road with the Hampton band in Iowa in 1946, Wilder and a fellow trumpeter were refused service at a Chinese restaurant in Des Moines.

They stayed for hours and the next day did the same, striking a chord of passive resistance years before the sit-ins that swept the South.

“We weren’t part of any movement or anything,” Wilder recalled. “We were just really hacked!”

When the legendary black dancer Bill “Bojangles” Robinson started telling degrading stories about “darkies” at a theater in Boston, Wilder and other horn players drowned him out with their instruments.

Born in Colwyn, Pennsylvania, on Feb. 22, 1922, Joseph Benjamin Wilder took music lessons as a child and, at 10, became a regular on a Philadelphia broadcast called “The Parisian Tailor’s Colored Kiddies Radio Hour.”

In 1950, he became one of the few black musicians to play for Broadway shows – first for a revue called “Alive and Kicking” and then for “Guys and Dolls.” Wilder and another black musician couldn’t travel to Washington, D.C., with “Guys and Dolls” because of objections from local musicians who would have been playing there with them.

In 1955, he was asked to be first trumpet for Cole Porter’s new musical “Silk Stockings.” The show’s producers felt obliged to ask Porter for his blessing. Porter’s response was straightforward: “Can the man play my music?”

Wilder played on dozens of albums, backing up performers such as Harry Belafonte, Pearl Bailey and Tony Bennett. He made only a few of his own albums over the years, including “The Pretty Sound of Joe Wilder” (1959) and “Among Friends” (2003).