You have asked an incredibly broad question so you cannot expect to receive a massively detailed answer. When I think of African Americans and music, I can't help but think of an excellent short story, that I recommend to you if you have not already read it, called "Sonny's Blues," which looks at the way in which Jazz music became a saving force for one African American youth in particular, but also for many others.
This question is too broad to be dealt with very effectively in this space. I will quickly point to two major ways in which music is said to have influenced African American life over the years.
First, music is said to have played a major role in allowing slaves to cope with their enslavement. Historians talk about how slaves used music to create a society of their own that could make them feel human even though they were caught in this dehumanizing institution of slavery. Historians also emphasize the rebellious power of music, such as the subversive meanings of some of the "spirituals." In these ways, music is said to have been a major way in which slaves resisted the slave system.
Second, music has offered many African Americans a way to express themselves and show their talents in a way that was acceptable to the white community. This was true, for example, during the Jazz Age when jazz music was invented by African Americans and allowed many blacks to have careers and to be (relatively speaking) respected by whites. As the link below says of this era,
The innovations and achievements of these and other black musicians in the 1920s proved to be the first widespread fulfillment of black American talent and genius.
You can say that this function of music has continued even to the present, though African Americans of course have many other ways to achieve and be accepted in today's society.