hi
well i have a program that can print wav data in a text file. Is it possible to make a wav file with the available data from the text file and play it in VB. Playing the file isn't that difficult, but i m still scratching my brains as to how to make the wav file.
Thank You!

Is it possible to make a wav file with the available data from the text file and play it in VB.

In programming just about anything is possible. But if you're asking this question thinking that VB has a built in capability to do what you're asking, think again.

You're greatest chance of success of doing what you're asking comes from the program that is able to convert the wav file into a text file. Does that program have the capability to convert the text back into a wav file? And does that program offer any dll's or APIs that you can reference in VB to accomplish that goal.

The real person that you should be asking this question is the person who wrote the program that can convert a wav file into a text file.

what is the possible answer

I would say that you have two choices: (1) Check with the program that made the wave file. See if it comes with a dll that you can reference in your program to accomplish what you ask , or (2) Identify the wave file with the text file so that you know which text file represents which wave file.

If the first choice is a possibility, you will have to figure out how to use that program's dll in your program.

The second choice is easier and only requires a little imagination. I would just use the first 20 or so characters of the text file created from the wave file and use it to identify the wave file.

Make a one-to-one association between that text value and your wave file. Based on the identity of the text file, just play the wave file that corresponds to the text file. You don't have to convert the file from text to wave, you just play the appropriate file based on the value of the first 20 or so characters that the program produces.

In programming just about anything is possible. But if you're asking this question thinking that VB has a built in capability to do what you're asking, think again.

You're greatest chance of success of doing what you're asking comes from the program that is able to convert the wav file into a text file. Does that program have the capability to convert the text back into a wav file? And does that program offer any dll's or APIs that you can reference in VB to accomplish that goal.

The real person that you should be asking this question is the person who wrote the program that can convert a wav file into a text file.

Well the program that i have is actually a C program that can print data in a text file. It doesnt even print the numbers but makes a "wave-like" design using " * " (I compared the design to the design made in this software called Audacity and it is the same, which means that the text file is showing me the correct data in form of a vertical graph of asterisks). But what i want to do is to make a wav file from the data that is present in the text file so that i can create a new wav file, exactly the same as that from which the data was extracted and put in the text file.

anyways thnx hkdani for helping me...
i am eager for your next reply...
thnx

Well the program that i have is actually a C program that can print data in a text file. It doesnt even print the numbers but makes a "wave-like" design using " * "

Do you have the code for the C program?

If it's taking advantage of one of Microsoft's DirectX SDK APIs, a C programmer could probably take advantage of the same API's to produce a wave file from the text data. But more than likely a lot of the information about the original sound (texture, quality, resonance, etc.) would be lost.

The C program probably just extracts the frequency and the duration of the pitch and outputs a text character at a particular position. It's not that complicated. But I wouldn't bet the outhouse on being able to reproduce the same original sound from just the text data.

Hank

This article has been dead for over six months. Start a new discussion instead.