0
0

Regarding;
[quote:tu3dlbwp]
FMOD_RESULT System::playDSP(
FMOD_CHANNELINDEX channelid,
FMOD::DSP * dsp,
bool paused,
FMOD::Channel ** channel
);
[/quote:tu3dlbwp]

Specifically;
[quote:tu3dlbwp]
paused
True or false flag to specify whether to start the channel paused or not. Starting a channel paused allows the user to alter its attributes without it being audible, and unpausing with Channel::setPaused actually starts the dsp running.
[/quote:tu3dlbwp]

Within a few lines of my source are calls to playDSP with pause set to ‘FALSE.’ It still pauses regardless as I hit every other key. Here is my scenario:

I’ve mapped a series of keys on my computer keyboard to audio frequencies in order to mimic a piano keyboard. I’ve defined each key as:

[code:tu3dlbwp]
static void key(unsigned char key, int x, int y)
{
float MusicalNote = 0.0;
switch (key)
{
case ‘a’:
MusicalNote = freqNote(1.0, 440.0);
fmresult = FMOD_DSP_SetParameter(fmdsp, FMOD_DSP_OSCILLATOR_RATE, MusicalNote);
fmresult = FMOD_System_PlayDSP(fmsystem, FMOD_CHANNEL_REUSE, fmdsp, FALSE, &fmchannel);
fmresult = FMOD_DSP_SetParameter(fmdsp, FMOD_DSP_OSCILLATOR_TYPE, 0);
break;

// ...
[/code:tu3dlbwp]

Any ideas as to why my audio is constantly pausing? It’s really frustrating. The above function is for GLUT. Just fyi.

If, for example, I hit ‘a’ on my keyboard it will pause and unpause the audio, instead of just playing it still. or if i press ‘a’ and then some other letter, still it only pauses the ‘a’ designated sound… i have to press the button another time for it to play the other buttons sound.

  • You must to post comments
0
0

Never mind, I found a solution.

[code:24i45eea]
switch (key)
{
case ‘a’:
fmdsp = 0;
fmresult = FMOD_System_CreateDSPByType(fmsystem, FMOD_DSP_TYPE_OSCILLATOR, &fmdsp);
MusicalNote = freqNote(1.0, 440.0);
fmresult = FMOD_DSP_SetParameter(fmdsp, FMOD_DSP_OSCILLATOR_RATE, MusicalNote);
fmresult = FMOD_DSP_SetParameter(fmdsp, FMOD_DSP_OSCILLATOR_TYPE, fmwaveType);
fmresult = FMOD_System_PlayDSP(fmsystem, FMOD_CHANNEL_REUSE, fmdsp, FALSE, &fmchannel);
break;

// ...
[/code:24i45eea]

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.