Hello
I create a new thread because when I try to open the other thread it causes an error ("error on page,try again") and I dont know why.
When I added the function of Mark Heath to Frogleg's code it works for me,I changes a little things on the code of each code and now I can hear sound from any speaker :)
Loading
nicole castelPosted May 6, 2011, 3:40 PM
Thank you Frogleg for replying :)
Thak you Sam,I understand and I'm sorry.
nicole castelPosted May 6, 2011, 3:40 PM
Thank you Frogleg for replying :)
Thak you Sam,I understand and I'm sorry.
FroglegPosted May 6, 2011, 4:26 AM
Sam HobbsPosted May 6, 2011, 12:02 AM
There are many articles in this web site to help you; read some of them. When you have a specific question, create a new thread for your database question.
I am sorry if this sounds unfriendly, but it is the answer that I and other members are likely to provide in this situation.
nicole castelPosted May 5, 2011, 10:56 AM
Please can you give me the code that allows me to read a file.wav ("alarme.wav") stored in a database, I tried the following code:
private void button1_Click (object sender, EventArgs e)
{
OdbcConnection cn = new OdbcConnection ("DSN = cp1");
cn.Open ();
OdbcCommand cmd1 = new OdbcCommand ("select path from WHERE Code Alarm alarm = 32 ", cn);
cmd1.Connection = cn;
fileName = cmd1.ToString ();
WaveOut wave = new ();
wave.DeviceNumber = 0;
playSound (0);
But he gave me the following error:
"Could not find file 'C: \ Users \ wafa \ Documents \ Visual Studio 2010 \ Projects \ ALARMED \ ALARMED \ bin \ Debug \ System.Data.Odbc.OdbcCommand'."
At the line:
"waveReader = new NAudio.Wave.WaveFileReader (fileName);" in my "playSound" function:
public void PlaySound (int deviceNumber)
{
disposeWave ();// stop previous sounds Before Starting
waveReader = new NAudio.Wave.WaveFileReader (fileName);
var waveOut NAudio.Wave.WaveOut = new ();
waveOut.DeviceNumber = deviceNumber;
var output = waveOut;
output.Init (waveReader);
output.Play ();
}
Thank you in advance
nicole castelPosted May 4, 2011, 4:09 PM
Now I'll try to ameliorate the code using data bases.
I'll post the code when I find something new and when I complete the project I'll post the final code here in csharp corner
FroglegPosted May 4, 2011, 1:37 PM
So every thing is working now ?
I don't know what happened to the other thread -not that it matters