The Sharps carbines of the Civil War period used linen cartridges, not metallic. Spencer cartridges were copper-cased rimfires but the proportions look wrong; the case looks too long in comparison to the bullet to be a Spencer cartridge, though it is hard to say for sure from a photograph. The quarter for scale does not help much. Measurements of the case length and diameter are necessary for an identification.
Does the case have two tiny and hard-to-see dents opposite each other just above the rim? If so this would identify it as a post-Civil War inside-primed cartridge. It could also be a rimfire, though the rim looks a little thin to hold much of a charge of fulminate. Without any measurements my best guess, just going by the length-to-diameter ratio, would be that it is a revolver cartridge.