22#ifndef PELROCK_SOUND_H
23#define PELROCK_SOUND_H
25#include "audio/mixer.h"
35extern const char *SOUND_FILENAMES[];
52const int kMaxChannels = 15;
53const int kAmbientSoundSlotBase = 4;
59 void playSound(
byte index,
int channel = -1,
int loopCount = 1);
60 void playSound(
const char *filename,
int channel,
int loopCount = 1);
61 void playSound(
byte *soundData, uint32 size,
int channel);
63 void stopSound(
int channel);
65 void setVolumeSfx(
int volume);
66 void setVolumeMusic(
int volume);
67 void setVolumeMaster(
int volume);
68 int getVolumeSfx()
const;
69 int getVolumeMusic()
const;
70 int getVolumeMaster()
const;
72 bool isPlaying()
const;
73 bool isPlaying(
int channel)
const;
74 bool isSoundIndexPlaying(
byte index)
const;
75 void loadSoundIndex();
77 bool isMusicPlaying();
78 void playMusicTrack(
int trackNumber,
bool loop =
true);
90 bool isPaused()
const {
return _isPaused; }
91 byte getCurrentMusicTrack()
const {
return _currentMusicTrack; }
94 int playSound(SonidoFile sound,
int channel = -1,
int loopCount = 1);
95 SoundFormat detectFormat(
byte *data, uint32 size);
96 int getSampleRate(
byte *data, SoundFormat format);
97 int findFreeChannel();
104 byte _sfxSoundIndex[kMaxChannels];
106 bool _isPaused =
false;
107 byte _currentMusicTrack = 0;
110 uint32 _cdTrackStart = 0;
111 uint32 _cdTrackDuration = 0;
112 uint32 _cdPlayStartTime = 0;
int tickAmbientSound(uint32 frameCount)