0
0

Hi,

I try to use spectrum analysis on audio sound card input but it s not working

as far as i understand, I have to record the sample and play it back but i probably miss of piece of code

[code:2ug4hecp]

system->setOutput(FMOD_OUTPUTTYPE_ASIO);
system->setRecordDriver(0);

result = system->init(16, FMOD_INIT_NORMAL, 0);
ERRCHECK(result);

memset(&exinfo, 0, sizeof(FMOD_CREATESOUNDEXINFO));

exinfo.cbsize           = sizeof(FMOD_CREATESOUNDEXINFO);
exinfo.numchannels      = 2;
exinfo.format           = FMOD_SOUND_FORMAT_PCM16;
exinfo.defaultfrequency = 44100;
exinfo.length           = exinfo.defaultfrequency * sizeof(short) * exinfo.numchannels * 2;


system->createSound( 0, FMOD_2D | FMOD_SOFTWARE | FMOD_OPENUSER, &exinfo, &sound);


system->recordStart(sound,TRUE);


system->playSound(FMOD_CHANNEL_REUSE, sound, false, &channel);

[/code:2ug4hecp]

i think something is missing btw recordStart and playSound but dunno what..
๐Ÿ˜‰

  • You must to post comments
0
0

[quote:1q5cc98n][code:1q5cc98n]system->createSound( 0, FMOD_2D | FMOD_SOFTWARE | FMOD_OPENUSER, &exinfo, &sound);[/code:1q5cc98n] [/quote:1q5cc98n]

Seems, that the 0 should be system. Your not sending the sound anywhere.

  • You must to post comments
0
0

oh.. excuse me, you may be using c. I think that 0 should be the maximum number of channels. change that to at least 2, and you should hear something.

  • You must to post comments
0
0

[code:1dptynk9]
FMOD_RESULT F_API createSound (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);
[/code:1dptynk9]

number of channel is handled by FMOD_CREATESOUNDEXINFO structure.

  • You must to post comments
0
0

any ideas ? i still cant find what s wrong and how to fix

thanks in advance

  • You must to post comments
0
0

Hello,

I em new, my englisch is bad sorry for that.
I have made the same code of thes you try to do but i have use a loop,
I make a sound of 6 sec and record in loop to it,
then i take a pause of 10 ms and play this sound in loop to.
this do it fine.

you can after thad you can inplement your spectrum analyser or watherver you want.

notice also thad you record from your record device,
not from your line in or so.
you must define in windows wath you want to use to record from.
line-in, mic, sum,…
if you use the sum (speakers) you have to set the volume of your playing sound off, other wise you record wat you are playing and it wil turn in a nice echo efect.

I do it al fine, but …
i have an other problem,
Wen i let my program run for a few ours i notis a diference in my play and record speed my record speed seems to be ok,
but my play speed encraise badly.
wath can i do to solve this.
unfortunatly i program in visual basic 6.0.

any idee? ๐Ÿ˜•

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.