The acoustic data in terms of compressional and shear wave velocity provide important petrophysical information about the rock. The sonic data is a significant input that is commonly used for deriving geomechanical parameters. Understanding the geomechanical properties of reservoir rock is essential during the drilling, development, production, and stimulation of an oil or gas reservoir. Among them, Young's modulus and Poisson's ratio are the most important elastic parameters. These properties are usually estimated from bulk density, compressional and shear wave velocity log data. Sonic data acquisition is usually achieved through dipole sonic imager log or laboratory testing on core samples which is costly and time-consuming. Acquiring sonic data from wireline logs is not feasible approach all the time; as the wireline log, specially shear-wave log, may not be recorded for every well. However, drilling data is available in a real-time for every well using real-time drilling sensors. The main objective of this paper is to predict sonic slowness logs in real-time based on the drilling data using artificial neural network (ANN). The data used in this study were recorded during the drilling of 12 ¼” hole sections from two wells. Many formations of different lithology were penetrated while drilling these sections of over 3000 ft vertical interval. The drilling and sonic datasets were recorded and preprocessed before using them for the ANN model. 2900 data points from the first well were used for building and testing the model. The input parameters included weight on bit (WOB), torque (T), standpipe pressure (SPP), pipe speed (PS), rate of penetration (ROP), and mud flow rate (Q). Another dataset of 2000 data points from the second well that was drilled in the same field was used to validate the model. The predictions were compared with sonic logs that were obtained after the drilling operation and the results appear to be highly promising for future applications. The sonic slowness ANN models showed a high accuracy for the model building (training and testing). Validation of these models was carried out using an unseen dataset. The results using the validation dataset for the compressional slowness model yielded a coefficient of determination (R2) of 0.983 and average absolute percentage error (AAPE) of less than 1.25%. For the shear slowness model, R2 was higher than 0.994 and AAPE less than 1.175%. The study offers empirical correlations that can be utilized to estimate the sonic slowness logs by engineers without the need to employ ANN software. The new shear slowness correlation was compared with other widely used correlations and the results showed high accuracy.