Click here to Skip to main content
15,921,905 members
Home / Discussions / C#
   

C#

 
GeneralRe: Combobox DataSource Pin
Christian Graus11-Jan-06 13:41
protectorChristian Graus11-Jan-06 13:41 
GeneralRe: Combobox DataSource Pin
code_wiz11-Jan-06 14:39
code_wiz11-Jan-06 14:39 
GeneralRe: Combobox DataSource Pin
Christian Graus11-Jan-06 14:42
protectorChristian Graus11-Jan-06 14:42 
GeneralRe: Combobox DataSource Pin
microsoc11-Jan-06 16:29
microsoc11-Jan-06 16:29 
GeneralRe: Combobox DataSource Pin
code_wiz11-Jan-06 22:18
code_wiz11-Jan-06 22:18 
Questionis datarow selected? Pin
melanieab11-Jan-06 10:47
melanieab11-Jan-06 10:47 
AnswerRe: is datarow selected? Pin
melanieab11-Jan-06 10:59
melanieab11-Jan-06 10:59 
Questionhow to use sound files in C# ? Pin
crusher_shark11-Jan-06 8:54
crusher_shark11-Jan-06 8:54 
if I have some sound Files , and I want to play them one after the other , the performance of hearing them not good because the time to call each one . So, I try to use a MemoryStream to make the sound files become a single group so, I will need only one call , but I failed to make it .
Then I used FileStream to create a sound file and I called it "sound.WAV" , and by using for loop append the sound files in "sound.WAV" , but only the first file appended
...............
I hope you to help me ... here my code after seeing your site .. Really it is a good site ...
//------- here my code --------
public class WAVSounds
{
[DllImport("WinMM.dll")]
public static extern bool PlaySound(byte[]wfname, int fuSound);

// flag values for SoundFlags argument on PlaySound
public int SND_SYNC = 0x0000; // play synchronously (default)
public int SND_ASYNC = 0x0001; // play asynchronously
public int SND_NODEFAULT = 0x0002; // silence (!default) if sound not found
public int SND_MEMORY = 0x0004; // pszSound points to a memory file
public int SND_LOOP = 0x0008; // loop the sound until next sndPlaySound
public int SND_NOSTOP = 0x0010; // don't stop any currently playing sound

public int SND_NOWAIT = 0x00002000; // don't wait if the driver is busy
public int SND_ALIAS = 0x00010000; // name is a registry alias
public int SND_ALIAS_ID = 0x00110000; // alias is a predefined ID
public int SND_FILENAME = 0x00020000; // name is file name
public int SND_RESOURCE = 0x00040004; // name is resource name or atom
public int SND_PURGE = 0x0040; // purge non-static events for task
public int SND_APPLICATION = 0x0080; // look for application specific association

//--------------------------------------------------------------------
public WAVSounds()
{
}
//-------------------------------------------------------------------
~WAVSounds()
{
}
//-------------------------------------------------------------------
public void Play(string wfname,int SoundFlags)
{
byte[] bname = new Byte[256]; //Max path length
bname = System.Text.Encoding.ASCII.GetBytes(wfname);
PlaySound(bname,SoundFlags);
}

//--------------------------------------------------------------------
public void PlayMS(byte[] memory,int SoundFlags)
{
//PlaySound( memory, SND_MEMORY | SND_SYNC );
PlaySound( memory,SoundFlags);
}
//--------------------------------------------------------------------
public void StopPlay()
{
PlaySound(null,SND_PURGE);
}
//----------------------------------------------------------------------
} //End WAVSounds class
//----------------------------
//--- In my Button I wrote ---------
WAVSounds ws = new WAVSounds();
MemoryStream ms = new MemoryStream();

FileStream fsr;
FileStream fsw;
byte[] SoundBuffer = new byte[Max*Max];
//-------------------------------------------------------
// ----------- File Stream ----------
//*************************************
fsw = new FileStream(path+"sound.WAV", FileMode.Create, FileAccess.Write);
//fsw.Close();
int i=0;
//**************************************
// fsw = new FileStream("D:\\c\\Project\\agents\\New Designe\\TextToSpeach\\sound.WAV", FileMode.Append , FileAccess.Write);
fsr = new FileStream(Sound[i],FileMode.Open );
for(i=0;i
AnswerRe: how to use sound files in C# ? Pin
Judah Gabriel Himango11-Jan-06 10:00
sponsorJudah Gabriel Himango11-Jan-06 10:00 
GeneralRe: how to use sound files in C# ? Pin
crusher_shark11-Jan-06 10:54
crusher_shark11-Jan-06 10:54 
AnswerRe: how to use sound files in C# ? Pin
Christian Graus11-Jan-06 10:53
protectorChristian Graus11-Jan-06 10:53 
GeneralRe: how to use sound files in C# ? Pin
crusher_shark11-Jan-06 11:08
crusher_shark11-Jan-06 11:08 
GeneralRe: how to use sound files in C# ? Pin
Christian Graus11-Jan-06 11:09
protectorChristian Graus11-Jan-06 11:09 
GeneralRe: how to use sound files in C# ? Pin
crusher_shark11-Jan-06 11:24
crusher_shark11-Jan-06 11:24 
GeneralRe: how to use sound files in C# ? Pin
Christian Graus11-Jan-06 11:32
protectorChristian Graus11-Jan-06 11:32 
GeneralRe: how to use sound files in C# ? Pin
crusher_shark11-Jan-06 11:45
crusher_shark11-Jan-06 11:45 
GeneralRe: how to use sound files in C# ? Pin
Christian Graus11-Jan-06 11:58
protectorChristian Graus11-Jan-06 11:58 
GeneralRe: how to use sound files in C# ? Pin
crusher_shark11-Jan-06 12:15
crusher_shark11-Jan-06 12:15 
GeneralRe: how to use sound files in C# ? Pin
Christian Graus11-Jan-06 12:18
protectorChristian Graus11-Jan-06 12:18 
GeneralRe: how to use sound files in C# ? Pin
crusher_shark11-Jan-06 12:29
crusher_shark11-Jan-06 12:29 
AnswerRe: how to use sound files in C# ? Pin
mav.northwind12-Jan-06 2:04
mav.northwind12-Jan-06 2:04 
QuestionIP Address of a client Pin
Gywox11-Jan-06 6:28
Gywox11-Jan-06 6:28 
AnswerRe: IP Address of a client Pin
User 665811-Jan-06 7:25
User 665811-Jan-06 7:25 
QuestionGetting Process informations through C# Pin
coolestCoder11-Jan-06 6:10
coolestCoder11-Jan-06 6:10 
AnswerRe: Getting Process informations through C# Pin
Dave Kreskowiak11-Jan-06 7:28
mveDave Kreskowiak11-Jan-06 7:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.