renderd7/sound.hpp

30 lines
593 B
C++
Raw Normal View History

2021-07-23 15:58:16 +02:00
#pragma once
#include <3ds.h>
#include <string>
2021-07-24 23:59:29 +02:00
/** Sound Class */
2021-07-23 15:58:16 +02:00
class sound {
public:
2021-07-24 23:59:29 +02:00
/**
2021-07-25 00:07:17 +02:00
Construct new Soundeffect
path: Path to the .wav file
channel: the channel 1-23
toloop: true:loop the sound, false: don't loop
2021-07-25 00:02:30 +02:00
*/
2021-07-23 15:58:16 +02:00
sound(const std::string& path, int channel = 1, bool toloop = false);
2021-07-24 23:59:29 +02:00
/** deconstruct the sound */
2021-07-23 15:58:16 +02:00
~sound();
2021-07-24 23:59:29 +02:00
/** play the sound */
2021-07-23 15:58:16 +02:00
void play();
2021-07-24 23:59:29 +02:00
/** stop the sound */
2021-07-23 15:58:16 +02:00
void stop();
private:
u32 dataSize;
ndspWaveBuf waveBuf;
u8* data = NULL;
int chnl;
};