I created a web service to retrieve the audio streams from my logs database. For testing, I have included code to write the bytes to a file. The problem is, the resulting file is not an audio file.
Should I be doing some conversion of the byte encoding?
public byte[] GetSoundFile(int FileID)
{
byte[] ByteArray = null ;
try
{
using (SqlConnection SqlConn = new SqlConnection(@"Server=(local);User ID=dev;password=dev;Database=Logs"))
{
SqlCommand SqlComm = new SqlCommand(String.Format("SELECT Data FROM EngineRecoAudioData WHERE SpeechRequestID={0}", FileID), SqlConn);
SqlConn.Open();
object TempObject = SqlComm.ExecuteScalar();
SqlConn.Close();
if (TempObject != null)
{
ByteArray = (byte[])TempObject;
}
using (System.IO.FileStream fs = new System.IO.FileStream("d:\\temp\\fromMSS.wav", System.IO.FileMode.Create))