 |
|
 |
Hi every body
i am new. i want little help in c++.Help me in Array C++. If auy body have a code then send me.
|
|
|
|
 |
|
 |
yah help me plz plz, I cann't understand you.
How can I insert a sound to my project ?
I use C++ with openGL library and I want to add a sound to my project.
I couldn't load your files, why ?
|
|
|
|
 |
|
 |
use this code:
first of all, put this in your main function:
System.Media.soundPlayer song = new System.Media.soundPlayer();
song.SoundLocation = "PUT WHEREVER YOUR SONG IS IN HERE"();
song.Load();
and when you want to play your sound, put this code:
song.Play();
NOTE: this will only work with wav files!!!
|
|
|
|
 |
|
 |
When I try to compile I've 2 errors
- Error 1 fatal error C1083: Cannot open include file: 'fmod.h': No such file or directory, where can I find it ?
- Error 2 error BK1506 : cannot open file '.\debug\GabbyPlayer.sbr': No such file or directory BSCMAKE, ....... ?
Can U help me ? Thanks a lot
Alessio
|
|
|
|
 |
|
 |
man did you read the article
I said that was an engine from fmod
I gave you the website where you can find the whole SDK
http://www.sonicspot.com/fmod/fmod.html
have fun
gabby
|
|
|
|
 |
|
 |
hi gabby,
exe is working fine.
when i try to run code in ms vC 6
unable to load these two header files
fmoddyn.h
psapi.h
fmod sdk download does not contain fmoddyn.h
please tell how to include them.
indee
|
|
|
|
 |
|
 |
i got the psapi.h file and fmoddyn.h as well...
but the f.. . lib file is invalid or corrupt...
which version of fmod shoul i download for running ur code
320..357 or any specific
|
|
|
|
 |
|
 |
i got the psapi.h file and fmoddyn.h as well...
but the f.. . lib file is invalid or corrupt...
which version of fmod shoul i download for running ur code
320..357 or any specific
thanks in advance.
indee
|
|
|
|
 |
|
 |
Where can I download an example for Fmod- MFC project?
When I compile my project - it's all OK, but then I take a message "Unhandled exception in 1.exe (FMOD.DLL): 0xC0000005: Access Violation.
Here is my small module
#include
#include
#include "fmod.h"
#include "fmod_errors.h" /* optional */
#define ENABLEREVERB TRUE
#define RECORDRATE /*22050*/11025
#define RECORDLEN (RECORDRATE *1 ) /* seconds at RECORDRATE khz */
#define OUTPUTRATE /*22050*/11025
#define REVERB_NUMTAPS 7
typedef struct
{
FSOUND_DSPUNIT *Unit;
char *historybuff; /* storage space for tap history */
char *workarea; /* a place to hold 1 buffer worth of data (for reverb) */
int delayms; /* delay of reverb tab in milliseconds */
int volume; /* volume of reverb tab */
int pan; /* pan of reverb tab */
int historyoffset; /* running offset into history buffer */
int historylen; /* size of history buffer in SAMPLES */
} REVERBTAP;
/*
Reverb stuff
*/
REVERBTAP DSP_ReverbTap[REVERB_NUMTAPS];
int umain()
{signed char key;
FILE *fp;
//key=key - '1';
//if(key=='1') gss(key);
char *tptr;
char *the_my_transfer;
FSOUND_SAMPLE *samp1;
//signed char key;
signed char key0;
int driver, i, channel, originalfreq;
int bits = /*(mode & FSOUND_16BITS) /*? 16 : */8;
int channels = /*(mode & FSOUND_STEREO)/*? 2 : */ 1;
int lenbytes = FSOUND_Sample_GetLength(samp1) * channels * bits / 8;
int lenytes = FSOUND_Sample_GetLength(samp1) * 1 * bits / 8;
void *ptr1, *ptr2;
unsigned int len1, len2;
if (FSOUND_GetVersion() < FMOD_VERSION){printf("Error : You are using the wrong DLL version! You should be using FMOD %.02f\n", FMOD_VERSION);return 0;}
FSOUND_SetOutput(FSOUND_OUTPUT_DSOUND);
printf("Direct Sound");
printf(" Driver list\n");
printf("---------------------------------------------------------\n");
for (i=0; i < FSOUND_GetNumDrivers(); i++)
{printf("%d - %s\n", i+1, FSOUND_GetDriverName(i));}
printf("---------------------------------------------------------\n"); /* print driver names */
printf("Press a corresponding number or ESC to quit\n");
do
{//key = getch();
if (key == 27) {FSOUND_Close();return 0;}
driver = key - '1';}
while (driver < 0 || driver >= FSOUND_GetNumDrivers());
FSOUND_SetDriver(driver); /* Select sound card (0 = default) */
FSOUND_SetMixer(FSOUND_MIXER_QUALITY_AUTODETECT);
if (!FSOUND_Init(OUTPUTRATE, 64, FSOUND_INIT_ACCURATEVULEVELS))
{printf("Error!\n");printf("%s\n", FMOD_ErrorString(FSOUND_GetError()));return 0;}
printf(" Recording device driver list\n");
printf("---------------------------------------------------------\n");
for (i=0; i < FSOUND_Record_GetNumDrivers(); i++)
{printf("%d - %s\n", i+1, FSOUND_Record_GetDriverName(i)); /* print driver names */}
printf("---------------------------------------------------------\n"); /* print driver names */
printf("Press a corresponding number or ESC to quit\n");
do
{//key = getch();
if (key == 27) return 0;
driver = key - '1';}
while (driver < 0 || driver >= FSOUND_Record_GetNumDrivers());
printf("SERVER OR CILENT?\n");//key0=getch();
//key0=my_choice;
if (FSOUND_GetOutput() == FSOUND_OUTPUT_OSS)
{samp1 = FSOUND_Sample_Alloc(FSOUND_UNMANAGED, RECORDLEN, FSOUND_IMAADPCM|FSOUND_MONO | FSOUND_8BITS | FSOUND_UNSIGNED, RECORDRATE, 255, 128, 255);}
else
{samp1 = FSOUND_Sample_Alloc(FSOUND_UNMANAGED, RECORDLEN, FSOUND_IMAADPCM|FSOUND_STEREO | FSOUND_16BITS , RECORDRATE, 255, 128, 255);}
printf("\n");
////// SERVER //////////////////////
if(key0=='1')
{
printf("=========================================================================\n");
printf("Press a key to start recording 10 seconds worth of data\n");
printf("=========================================================================\n");
//getch();
if (!FSOUND_Record_StartSample(samp1, FALSE)) /* it will record into this sample for 5 seconds then stop */
{
printf("Error!\n");
printf("%s\n", FMOD_ErrorString(FSOUND_GetError()));
FSOUND_Close();
return 0;
}
do
{
printf("Recording position = %d\r", FSOUND_Record_GetPosition());
Sleep(50);
} while (FSOUND_Record_GetPosition() < RECORDLEN /*&& *kbhit()*/); //HERE
FSOUND_Record_Stop(); /* it already stopped anyway */
printf("\n=========================================================================\n");
printf("Press a key to play back recorded data\n");
printf("=========================================================================\n");
FSOUND_Sample_Lock(samp1, 0, lenbytes, &ptr1, &ptr2, &len1, &len2);
fp = fopen("temp.wws", "wb");
fwrite(ptr1, len1, 1, fp);
the_my_transfer=new char[len1];
for(int zz=0;zz
|
|
|
|
 |
|
 |
it's very kind of you
nothing
|
|
|
|
 |
|
|
 |
|
 |
hey man the library isn't mine
it's from fmod.com
the license is about 2000$ good luck
gabby
|
|
|
|
 |
|
 |
What's the point of doing a project, that is basically an advertisement for some non-free software. Any example that requires non-free third-party software is going to be mostly useless. This is just clogging up my google searches for a real solution.
|
|
|
|
 |
|
 |
This code has 2 problems:
Trying to load the file from the list songs[sel + 1].
The Accelerator function will never return.
Old dog learning new tricks!
|
|
|
|
 |
|
 |
the whole idea is not to return if you look more careful.
and what about songs[sel+1] it loads very well
gabby
|
|
|
|
 |
|
 |
your function: Accelerator() is started in a new thread that is never terminated and therefore causes a memory leak when the window is destroyed.
songs[sel+1] attempts to open an empty filename when it gets to the end of the list.
Old dog learning new tricks!
|
|
|
|
 |
|
 |
thanks for the tips dude I'll have to be more careful. The reason I posted this article is because I wanted people to have a more easy of playing mp3 files . and not only
gabby
|
|
|
|
 |
|
|
 |
|
 |
man this is moe of a demo project. I said you can find the whole programing object at www.fmod.com
Thank you
gabby
|
|
|
|
 |