feat: add sceSasCore library#359
Conversation
Adds prototypes for SceSasCore functions.
also removes an extra blankline
make it consistent.
makes comment reference PSP_SAS_NOISE_FREQ_MAX also removes blankline
changed the annotation of the square's duty cycle parameter to improve its wording.
clarified the loop parameter documentation to specify that the VAG file must contain the end loop flag for looping to work.
added a basic doxygen group (topic) for sceSasCore stuff, called "SAS Core Audio Library".
so these are __ prefixed in the cracked hashes too? would be quite practical to have a code example that illustrates the usage of these new APIs. |
Yes. All function names matches their NID hashes, with the only exception being
I'll look into making a sample for this. |
this description seems more fitting.
adds a sample that demonstrates how to use sceSasCore. Contain a couple of sounds created by me, too.
attempt to fix a hard-to-reproduce bug where the vag fanfare sound crackles shortly before loop.
|
Okay, so I made a quick sample project showcasing the library. It explains all basic functionality a developer might want to know, such as initialization code, playing multiple sounds at once, toggling reverb effects, outputting sound, and more. The sample also comes with 2 audio files:
Screenshot taken from my hardware The sample runs only on the main thread, which isn't great because of blocking audio functions, but its fine enough for a simple demo. I also added a README.md file inside the sample's folder, containing info and links to psxavenc, the open-source VAG encoder software I've used to generate |
… loop attempt pspdev#2 to fix the fanfare.vag loop crackling situation. If this doesn't fix it, then it's probably bc we are mixing/outputting the sound on the main thread.
- code cleanup. - ensure AudioClip->ptr is NULL when load fails. - don't hardcode loop on vag audio. - use (void) on parameter-less functions. - use left asterisk placement.
|
thanks for the PR and the sample showing how to use this sasCore library 👍 everything LGTM, but just in case I'm tagging @sharkwouter for his feedback, before merging changes |

This pull-request adds stubs, prototypes and documentation for the
sceSasCorelibrary, the official SCE's audio software mixer that runs on the Media Engine CPU. This API not only makes mixing trivial, but also grants.vagplayback and reverb effects with ease.Changes
sceSasCorefunctions.__sceSasfunction prototypes (29 out of 32) describing their behavior to the best of my understanding.Notes
The research/reimplementation done by the PPSSPP guys (referenced below) were used as basis, alongside tests I did on real hardware. The remaining undocumented functions are all ATRAC3-related and no further studies on them were done by me.
All function names are intentionally prefixed with double underscores (__). That's because SCE didn't intend these APIs to be used directly, but rather through the higher-level wrapper from the official PSP SDK (presumably called "sceSas"). Despite this, there's no special requirements to use the library's functionality.
Tested on
I also made sure that no new Doxygen warnings were introduced.
Reference Material