Skip to main content

News

Topic: What is SFXR? (Read 1789 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
What is SFXR?
While reviewing the Sphere 1.x docs I came across a bunch of sound-related functions with "SFXR" in their names.  What are these functions for?  Some sort of DSP filter system?
miniSphere 5.3.0 - Cell compiler - SSj debugger
forum thread | on GitHub

  • Rhuan
  • [*][*][*][*]
Re: What is SFXR?
Reply #1
I thought SFXR was 1.6 - I have an api.txt with it in but it's not in the one that comes with 1.5 if you download it now.

It was an interface for generating sounds by fiddling with some parameters - I never used it and no longer have a working version of 1.6 so can't comment further.

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: What is SFXR?
Reply #2
Yeah, I knew it was 1.6, I was looking at the api.txt in the git repo.  I just wondered what it was.
miniSphere 5.3.0 - Cell compiler - SSj debugger
forum thread | on GitHub

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: What is SFXR?
Reply #3
What Rhuan said - basically, a sound generator. I never use it myself because the sounds that come out of it tend to be very similar and overused in indie games.

Re: What is SFXR?
Reply #4
I was looking at that as well. It would bw nice to see some of its required functions implemented in miniSphere.

  • N E O
  • [*][*][*][*][*]
  • Administrator
  • Senior Administrator
Re: What is SFXR?
Reply #5
I'm late to the party here, but yea SFXR is for audio generation. In the future I would certainly like to see more generalized audio generation functions akin to the Web Audio API, but no skin off our backs if Sphere doesn't officially implement it.

  • FBnil
  • [*][*]
Re: What is SFXR?
Reply #6
Sorry for the lateness:
I took the code (with the blessings of the author) from http://www.drpetter.se/project_sfxr.html
And wrote an API for it for Sphere 1.6.
It was working, stable and tested.

There was a demo games/sfxr.zip and some unittests for it games/auto_test/scripts/test_sfxr.js
Are those resources needed?
If so, where can I upload them?

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: What is SFXR?
Reply #7
I think at this point, now that we're using ChakraCore instead of Duktape, I would probably want to implement something like this in JavaScript, on top of SoundStream, rather than bloating the Core API with what is really high-level functionality.  Then it would even work in Oozaru (which also implements SoundStream) without further code changes.
miniSphere 5.3.0 - Cell compiler - SSj debugger
forum thread | on GitHub

  • FBnil
  • [*][*]
Re: What is SFXR?
Reply #8
Wow, I have not looked into SoundStream, but that sounds rad!
whoa, a whole re-implementation like that! Lot's of code, man!
https://github.com/fatcerberus/sphere-mp3/blob/master/lib/mp3.js

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: What is SFXR?
Reply #9
I didn't write that mp3 decoder, that was from this project:
https://github.com/audiocogs/mp3.js

SoundStream itself is really simple to use, you just specify your sample rate and feed it raw PCM audio.  Here's the API:
https://github.com/fatcerberus/minisphere/blob/master/docs/sphere2-core-api.txt#L2012-L2062
miniSphere 5.3.0 - Cell compiler - SSj debugger
forum thread | on GitHub