Infective endocarditis is an infection of the lining of the heart or the valves of the heart. Treatment may include a hospital stay, medicines, or surgery.