Those who knew Mr. Clementi — on the Rutgers campus in Piscataway, N.J., at his North Jersey high school and in a community orchestra — were anguished by the circumstances surrounding his death, describing him as an intensely devoted musician who was sweet and shy.

“It’s really awful, especially in New York and in the 21st century,” said Arkady Leytush, artistic director of the Ridgewood Symphony Orchestra, where Mr. Clementi played since his freshman year in high school. “It’s so painful. He was very friendly and had very good potential.”

The Middlesex County prosecutor’s office said Mr. Clementi’s roommate, Dharun Ravi, 18, of Plainsboro, N.J., and another classmate, Molly Wei, 18, of Princeton Junction, N.J., had each been charged with two counts of invasion of privacy for using “the camera to view and transmit a live image” of Mr. Clementi. The most serious charges carry a maximum sentence of five years.

Mr. Ravi was charged with two additional counts of invasion of privacy for trying a similar live feed on the Internet on Sept. 21, the day before the suicide. A spokesman for the prosecutor’s office, James O’Neill, said the investigation was continuing, but he declined to “speculate on additional charges.”

Steven Goldstein, chairman of the gay rights group Garden State Equality, said Wednesday that he considered the death a hate crime. “We are sickened that anyone in our society, such as the students allegedly responsible for making the surreptitious video, might consider destroying others’ lives as a sport,” he said in a statement.