how to save .wav file into ms sql server database?

Posted by Ramadevi under ASP.NET on 5/8/2013 | Points: 10 | Views : 3303 | Status : [Member] | Replies : 1
filrst i am saving .wav file path into text file and record file stored into a folder
my code is below

protected void save_Click(object sender, EventArgs e)
string websitePath = Request.PhysicalApplicationPath;
tring dirname = "D:/Windows Masterspell";
string appPath = HttpContext.Current.Request.ApplicationPath;
string filename = "TRecord.txt";
string i = websitePath + "\\TRecord.txt";

if (System.IO.File.Exists(i))
using (System.IO.StreamWriter sw = new System.IO.StreamWriter(i, true))
string date = DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss");
string currentPath = HttpContext.Current.Request.MapPath(appPath);
if (!Directory.Exists(websitePath + "RecordSounds"))
Directory.CreateDirectory(websitePath + "RecordSounds");
DirectoryInfo myDirectoryInfo = new DirectoryInfo(dirname );
string k = apppath + "\\RecordSounds\\" + date + ".wav";
mciSendString("save recsound " + k + "", "", 0, 0);
mciSendString("close recsound ", "", 0, 0);
sw.WriteLine("" + TextBox1.Text + "," + "user" + "," + k + "");

here i am saving recordfile ino a folder my problem is create folder is success but .wav file is not stored in folder ""RecordSounds"


Posted by: Raj.Trivedi on: 5/8/2013 [Member] [MVP] Starter | Points: 25

Hello Ramadevi

What you can do is that once the recording is complete save .wav file into the folder and its path directly to the database.

Once the file is in your Folder and the path in the database you can play the file from the path that is stored in the database.

Store the path this way


To Play the file

You can refer below links

"Sharing is Caring"
Please mark as answer if your Query is resolved

Ramadevi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response