// Callback function
static cpBool PlaySoundOnImpact(cpArbiter *arb, cpSpace *space, void *data){
PlayCrashSound();
return cpTrue;
}
// When setting up, reference your callback function:
{
...
cpCollisionHandler *handler = cpSpaceAddCollisionHandler(space, PLAYER, WALL);
handler->postSolveFunc = PlaySoundOnImpact;
...
}