0
0

Hi,

I try to create a non file based sound. 0x80 means silcence ( 8 Bit PCM ) But it always plays 2 beats. I can fill the buffer with every value, it plays always the 2 beats, so I think it ingores my buffer with raw data? But there are no errors. The functions return always FMOD_OK.

Source:

[code:nh7wlfyl]

include <iostream>

include <memory.h>

include "fmod.hpp"

int main()
{
char data[10000];
FMOD_RESULT result;
FMOD::System *system;
FMOD::Sound * sound;

result = FMOD::System_Create(&amp;system);      // Create the main system object.

result = system-&gt;init(100, FMOD_INIT_NORMAL, 0); // Initialize FMOD.

FMOD_CREATESOUNDEXINFO csi;
memset(&amp;csi,0,sizeof(csi));

csi.cbsize = sizeof(csi);
csi.format = FMOD_SOUND_FORMAT_PCM8; // 8 Bit
csi.numchannels = 1; // Mono 
csi.defaultfrequency = 11025; // 11,025 kHZ
csi.length = 10000; // 10000 length
memset(data,0x80,10000); // Silence...

result = system-&gt;createSound(data,FMOD_OPENUSER,&amp;csi,&amp;sound);

FMOD::Channel * channel;
result = system-&gt;playSound(FMOD_CHANNEL_FREE,sound,0,&amp;channel);


std::cin.get();
system-&gt;close();
system-&gt;release();

return 0;

}
[/code:nh7wlfyl]

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.