Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
Low-Pass Filter extension to ISoundEffectControl

niyr
Registered User
Quote
2013-12-11 04:36:14

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.


niko
Moderator
Quote
2013-12-11 08:18:18

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.


niyr
Registered User
Quote
2013-12-13 00:50:54

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?


erik
Registered User
Quote
2013-12-13 16:13:25

I think getting the PCMData doesn't work for streamed files. You could try to force it not to be streamed, though.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internatio?al" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact