Hawking radiation, the spontaneous emission of thermal photons from an event horizon, is one of the most intriguing and elusive predictions of field theory in curved spacetimes. A formally analogue phenomenon occurs at the supersonic transition of a fluid: in this respect, ultracold gases stand out among the most promising systems but the theoretical modelling of this effect has always been carried out in semiclassical approximation, borrowing part of the analysis from the gravitational analogy. Here we discuss the exact solution of a one-dimensional Bose gas flowing against an obstacle, showing that spontaneous phonon emission (the analogue of Hawking radiation) is predicted without reference to the gravitational analogy. Long after the creation of the obstacle, the fluid settles into a stationary state displaying the emission of sound waves (phonons) in the upstream direction. A careful analysis shows that a precise correspondence between this phenomenon and the spontaneous emission of radiation from an event horizon requires additional conditions to be met in future experiments aimed at identifying the occurrence of the Hawking-like mechanism in Bose-Einstein condensates.