Home Creators Posts Import Register Favorites Logout

Content

This could 100% be my personal bias, as I am often the one that's elbow-deep in SDL's audio subsystem, but when porting SDL to a new platform, I find starting with audio to be the easiest. Generally it'll work without any sort of GUI components wired up (or video at all!), so once the base library is compiling, filling in an audio backend and figuring out how to coerce loopwave.c to run on the device is usually the first step.

Enjoy!

Next up: getting some pretty pixels onto that gorgeous screen.  :)

Files

SDL2/switch: audio

Believe it or not, this code actually worked on the first run. :) If you want to support my work to get SDL running on consoles, and lots of other wild projects, throw in a few bucks at https://patreon.com/icculus Thanks!

Comments

cigumo

Yeah! :)

Aidy Capp

Hey Ryan, is this playing the stock "sample.wav" file that ships with SDL? I ask because I wondered if your "coercing" involved changing it from the ADPCM format before you could get it to play.

Ryan C. Gordon

"Coercing" in this case is "figure out how to compile a program for a platform," and I'm pretty sure sample.wav is just uncompressed data, but SDL_LoadWAV() transparently loads ADPCM data on the CPU. We don't feed compressed data to the audio hardware even if it supports it.