Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hello, I've been messing around with IrrKlang as a replacement for XACT (XNA's default audio engine) in a personal project of mine, and was wondering if it's possible to create a low pass filter as an extension to the ISoundEffectControl interface? Would it be best to access the waveform of a single ISound and transform the bit stream through a function, or is there a better way to do it? Thanks in advance. |
||||
|
No, sorry, AFAIK there is no way to do that currently. But yes, if you want to access the wave file before playing, this could be done: You can get the sample data from an ISound (SampleData property), do your filtering and create a new sound source from it, using AddSoundSourceFromPCMData. |
||||
|
Thanks for the quick reply. I've been trying to do as you suggested, but when using the code: ISoundSource src = engine.AddSoundSourceFromFile(@"..\..\Melody.ogg", StreamMode.AutoDetect, true); ISoundSource modified = engine.AddSoundSourceFromPCMData(LowPassFilter(src.SampleData, 6000, 1, src.AudioFormat.SampleRate, src.AudioFormat.ChannelCount), "Melody", src.AudioFormat); The src.SampleData field always results in a nullReferenceException, despite 'src' loading and being able to play correctly. What am I doing wrong whereby I can't access the SampleData property as you recommended? |
||||
|
I think getting the PCMData doesn't work for streamed files. You could try to force it not to be streamed, though. |
|