Click here to Skip to main content
16,014,952 members
Home / Discussions / C#
   

C#

 
GeneralConnection StringII Pin
Mazdak21-Apr-02 7:38
Mazdak21-Apr-02 7:38 
GeneralRe: Connection StringII Pin
Neil Van Note21-Apr-02 16:08
Neil Van Note21-Apr-02 16:08 
GeneralRe: Connection StringII Pin
Neil Van Note21-Apr-02 16:22
Neil Van Note21-Apr-02 16:22 
GeneralRe: Connection StringII Pin
Mazdak21-Apr-02 19:13
Mazdak21-Apr-02 19:13 
GeneralRe: Connection StringII Pin
Mazdak23-Apr-02 2:20
Mazdak23-Apr-02 2:20 
GeneralRe: Connection StringII Pin
Neil Van Note23-Apr-02 2:37
Neil Van Note23-Apr-02 2:37 
QuestionHow to play WAVE sound from resource? Pin
Szymon Pusz21-Apr-02 5:18
Szymon Pusz21-Apr-02 5:18 
AnswerRe: How to play WAVE sound from resource? Pin
James T. Johnson21-Apr-02 12:10
James T. Johnson21-Apr-02 12:10 
Since there isn't any managed methods for playing sounds you'll have to load the file from the stream into memory, then call the appropriate API function to do the actual playing.

To get the stream this should work.

public byte[] GetWave(string filename)
{
  Assembly asm = GetType().Assembly;
 
  Stream stream = asm.GetManifestResourceStream(filename);
  byte [] wav = new byte[stream.Length];
 
  stream.Read(wav, 0, wav.Length);
 
  return wav;
}
Untested but it should work since I wrote almsot the exact same code in another program.

I'm not familiar with the sound playing API though so you'll have to reference that on your own.

James

Simplicity Rules!
GeneralRe: How to play WAVE sound from resource? Pin
Szymon Pusz22-Apr-02 0:32
Szymon Pusz22-Apr-02 0:32 
GeneralRe: How to play WAVE sound from resource? Pin
Neil Van Note22-Apr-02 5:42
Neil Van Note22-Apr-02 5:42 
GeneralRe: How to play WAVE sound from resource? Pin
Szymon Pusz22-Apr-02 7:20
Szymon Pusz22-Apr-02 7:20 
QuestionShellExecute ? Pin
Christian Graus20-Apr-02 15:59
protectorChristian Graus20-Apr-02 15:59 
AnswerRe: ShellExecute ? Pin
James T. Johnson20-Apr-02 16:41
James T. Johnson20-Apr-02 16:41 
GeneralRe: ShellExecute ? Pin
James T. Johnson20-Apr-02 16:45
James T. Johnson20-Apr-02 16:45 
GeneralRe: ShellExecute ? Pin
Neil Van Note20-Apr-02 19:45
Neil Van Note20-Apr-02 19:45 
GeneralRe: ShellExecute ? Pin
Christian Graus21-Apr-02 10:51
protectorChristian Graus21-Apr-02 10:51 
GeneralRe: ShellExecute ? Pin
Neil Van Note21-Apr-02 11:00
Neil Van Note21-Apr-02 11:00 
GeneralRe: ShellExecute ? Pin
James T. Johnson21-Apr-02 11:31
James T. Johnson21-Apr-02 11:31 
GeneralRe: ShellExecute ? Pin
Christian Graus21-Apr-02 11:36
protectorChristian Graus21-Apr-02 11:36 
GeneralRe: ShellExecute ? Pin
James T. Johnson21-Apr-02 11:54
James T. Johnson21-Apr-02 11:54 
GeneralListView.Items.Contains() problem... Pin
20-Apr-02 15:18
suss20-Apr-02 15:18 
Generaloops... Pin
20-Apr-02 15:20
suss20-Apr-02 15:20 
GeneralRe: oops... Pin
20-Apr-02 15:28
suss20-Apr-02 15:28 
GeneralRe: oops... Pin
Neil Van Note20-Apr-02 19:37
Neil Van Note20-Apr-02 19:37 
GeneralRe: oops... Pin
20-Apr-02 22:54
suss20-Apr-02 22:54 

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.