Playing raw audio files thru c or c++
-
can anybody guide me to write c or c++ code to play an raw audio files thank you bye sham
-
can anybody guide me to write c or c++ code to play an raw audio files thank you bye sham
create a buffer with the characteristics of the raw sound (srate, bits etc) then copy the data in and start playing it. Don't try it, just do it! ;-)
-
create a buffer with the characteristics of the raw sound (srate, bits etc) then copy the data in and start playing it. Don't try it, just do it! ;-)
i didn't get what your are trying say. please an you be more specfic.
-
i didn't get what your are trying say. please an you be more specfic.
I propose that you use DirectSound. You create a buffer with the specifications of the wave data (sample rate, bits/blocksize, ...), then you lock the buffer, copy the data in, unlock it and then start playback. read the sdk for further information. Don't try it, just do it! ;-)
-
I propose that you use DirectSound. You create a buffer with the specifications of the wave data (sample rate, bits/blocksize, ...), then you lock the buffer, copy the data in, unlock it and then start playback. read the sdk for further information. Don't try it, just do it! ;-)
Here's what I do in Visual C++ 6.0. 1. Import the .wav file and name it something you'll remember, like IDR_BADBEEP. 2. Add #include "mmsystem.h" to the top of your file. 3. In Project/Settings/Link, add Winmm.lib 4. In the actual code where I want the sound effect to play, add: PlaySound(MAKEINTRESOURCE(IDR_BADBEEP),GetModuleHandle(NULL),SND_RESOURCE | SND_ASYNC); This will play the sound effect until the program is shut down, the sound effect is entirely played, or another sound effect is started. It's easy and works.:cool: Dimenser
-
can anybody guide me to write c or c++ code to play an raw audio files thank you bye sham
simple, to play a .wav file in VC++ use PlaySound(...) function //look for the parameters at www.msdn.com And dont forget to include the winmm.lib in the project settings.
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
-
simple, to play a .wav file in VC++ use PlaySound(...) function //look for the parameters at www.msdn.com And dont forget to include the winmm.lib in the project settings.
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
but i want play this raw with some sampling rate(Fs=8000), i don't thing this would support it.
-
Here's what I do in Visual C++ 6.0. 1. Import the .wav file and name it something you'll remember, like IDR_BADBEEP. 2. Add #include "mmsystem.h" to the top of your file. 3. In Project/Settings/Link, add Winmm.lib 4. In the actual code where I want the sound effect to play, add: PlaySound(MAKEINTRESOURCE(IDR_BADBEEP),GetModuleHandle(NULL),SND_RESOURCE | SND_ASYNC); This will play the sound effect until the program is shut down, the sound effect is entirely played, or another sound effect is started. It's easy and works.:cool: Dimenser
suggestion which you have given it support for only .wav file ,but i need to play .raw files at some sampling rate(Fs=8000).plz guide me.