Mike "riff"
Member
Started sound project, know my plan where I'm going just can't get past this function call. Anyone who know c++ really well that cant give suggestions.
Code:
#include <string>
class CreatureSounds
{
public:
CreatureSounds();
~CreatureSounds();
char filePath[20] = "../data/sound";
void getCreatureSound(const std::string& fileName);
private:
unsigned m_creatureSound = 0;
unsigned m_creatureGroup = 0;
unsigned m_numChannels = 0;
Code:
#include "CreatureSounds.h"
#include "soundsource.h"
#include <iostream>
CreatureSounds::CreatureSounds()
{
}
CreatureSounds::~CreatureSounds()
{
}
void CreatureSounds::getCreatureSound(const std::string& fileName) {
// how do I get creature name?
// creatureName = filename
std::ifstream file(filePath + fileName);
file.open(fileName);
if (file.fail()) {
ERROR_ALERTED;
std::cout << "File could not be found." << std::endl;
}
}