Fewer people are borrowing books, videos and other items from New York City libraries, but a growing number of residents are attending such library programs as film screenings and English language classes, according to city data.

Use of the city’s libraries has fallen, according to a report issued Tuesday by the New York City Independent Budget Office. Libraries in the five boroughs recorded nearly 45.7 million visits in 2009, but saw attendance drop to 37.5 million visits last year, a decline of almost 18 percent.

Although the total number of library visits has fallen, libraries are seeing a boost in the numbers of people attending various programs, from films to classes to speaking engagements.

Attendance at such programs has doubled since 2007, when 1.9 million people took advantage of the library events. Last year, nearly 4 million people attended library programs, the budget office said.

“Over the past several years, branch libraries in all three systems have become broader community resources rather than repositories of books and information,” wrote Katie Hanna, author of the report.

The three systems are Brooklyn, Queens and the combination of Manhattan, Staten Island and the Bronx.

As fewer visits are recorded at libraries, the number of borrowed books and other material has also declined. Last year, 50.7 million items were circulated, a 25 percent decrease from 2011, the report states.

However, the use of wireless services offered by libraries is on the upswing. About 3.6 million WiFi sessions happened at libraries last year, nearly double the amount in 2007, the report states.

The budget office found that boosting city subsidies to allow library branches to be open six days a week did almost nothing to attract more users.