quick help with fmod?
BlitzMax Forums/BlitzMax Programming/quick help with fmod?
| ||
I'm wanting to directly access the waveform data that fmod uses. does anyone know how to do this? I've been through bruceys mod and there are omissions such as Lock and unlock which would be the functions i think I need. I'm wanting to be able to create an empty wave that I can fill myself heres a snip of code I've been working on but can't get it to actually sound yet ;( Local mode:Int=FMOD_2D|FMOD_LOOP_NORMAL|FMOD_SOFTWARE|FMOD_OPENMEMORY Local createsoundexinfo:TFMODCreateSoundExInfo=New TFMODCreateSoundExInfo Local channels:Int = 1 Local sampleLength:Int=250 * channels Local count:Int Print "create sample" Local sample:TAudioSample = TAudioSample.Create(sampleLength, 44100, SF_MONO16LE) Global AudioPtr:Short Ptr = Short Ptr(Sample.samples) Print"fill sample" For Local i:Int = 0 To sampleLength-1 AudioPtr[i] = Sin(i*3.6)*32760 Next Print "transfer to fmod" Local exinfo:TFMODCreateSoundExInfo = New TFMODCreateSoundExInfo exinfo.SetLength(sample.length) exinfo.SetNumChannels(channels) 'Number of channels in the sound. exinfo.SetDefaultFrequency(44100) 'Default playback rate of sound. exinfo.SetFormat(FMOD_SOUND_FORMAT_PCM16) 'Data format of sound. ' Local this:TFMODSound = system.CreateSoundPtr(AudioPtr, mode, exinfo) Local this:TFMODSound = system.CreateSoundPtr(sample.samples, mode, exinfo) Last edited 2011 |