Skip to content

v1.7.3-beta.6

Choose a tag to compare

@saiitanaa saiitanaa released this 06 Jun 07:32
· 32 commits to main since this release
d3e97f4
image

Fast CIA Installation

ReSharp3DS-QR_CODE

ReSharp3DS Runtime Update

  • Add app file explorer
  • New Makefile
  • Dynamic Native Method Mapping

ReSharp3DS SDK Update

  • Add Audio Support

Available methods:

Audio.Init();
Audio.Beep(int frequency, int durationMs);
Audio.PlayWav(string path);
Audio.SetVolume(int volume);
Audio.Loop(string path);
Audio.StopMusic();
Audio.Stop();
Beep / frequency audio
Audio.Beep(440, 200);
Audio.Beep(880, 150);
Custom WAV playback
Audio.PlayWav("audio.wav");
Audio.PlayWav("sfx/jump.wav");

Paths can be relative to the launched .pe file or absolute:

Audio.PlayWav("sdmc:/MyGame/sounds/select.wav");

Recommended WAV format:

PCM 16-bit
Mono or stereo
44100 Hz or 22050 Hz
Music looping
Audio.SetVolume(80);
Audio.Loop("music.wav");
Audio.StopMusic();

Exemple

namespace ReSharp3DS
{
    public class Program
    {
        static bool initialized = false;
        static bool oldA = false;
        static bool oldX = false;
        static bool oldY = false;

        public static void Main()
        {
            if (!initialized)
            {
                initialized = true;

                Console.Clear();
                Console.WriteLine("Audio test");

                Audio.Init();
                Audio.SetVolume(80);
                Audio.Loop("music.wav");
            }

            bool a = Input.IsAPressed();
            bool x = Input.IsXPressed();
            bool y = Input.IsYPressed();

            if (a && !oldA)
            {
                Audio.PlayWav("audio.wav");
            }

            if (x && !oldX)
            {
                Audio.SetVolume(40);
            }

            if (y && !oldY)
            {
                Audio.StopMusic();
            }

            oldA = a;
            oldX = x;
            oldY = y;

            Runtime.Yield();
        }
    }
}