xoreos
0.0.5
|
Class to hold audio resources and information of a Wwise soundbank file. More...
#include <wwisesoundbank.h>
Classes | |
struct | File |
An embedded sound file within the SoundBank. More... | |
struct | Sound |
Public Member Functions | |
WwiseSoundBank (Common::SeekableReadStream *bnk) | |
WwiseSoundBank (const Common::UString &name) | |
WwiseSoundBank (uint64 hash) | |
~WwiseSoundBank () | |
size_t | getFileCount () const |
Return the number of embedded files. More... | |
size_t | getSoundCount () const |
Return the number of sounds this bank references. More... | |
uint32 | getFileID (size_t index) const |
Return the ID of an embedded file. More... | |
uint32 | getSoundID (size_t index) const |
Return the ID of a referenced sound. More... | |
uint32 | getSoundFileID (size_t index) const |
Return the ID of a file used by a referenced sound. More... | |
size_t | findFileByID (uint32 id) const |
Return the index of a file from its ID, or SIZE_MAX if not found. More... | |
size_t | findSoundByID (uint32 id) const |
Return the index of a sound from its ID, or SIZE_MAX if not found. More... | |
RewindableAudioStream * | getFile (size_t index) const |
RewindableAudioStream * | getSound (size_t index) const |
Private Types | |
enum | SoundType { kSoundTypeSFX, kSoundTypeVoice, kSoundTypeMusic } |
Private Member Functions | |
void | load (Common::SeekableReadStream &bnk) |
const File & | getFileStruct (size_t index) const |
const Sound & | getSoundStruct (size_t index) const |
bool | isEmptyFile (size_t index) const |
bool | isEmptySound (size_t index) const |
Common::SeekableReadStream * | getFileData (size_t index) const |
Common::SeekableReadStream * | getSoundData (size_t index) const |
Private Attributes | |
Common::ScopedPtr< Common::SeekableReadStream > | _bnk |
uint32 | _bankID |
size_t | _dataOffset |
std::vector< File > | _files |
std::vector< Sound > | _sounds |
std::map< uint32, Common::UString > | _banks |
std::map< uint32, size_t > | _fileIDs |
std::map< uint32, size_t > | _soundIDs |
Class to hold audio resources and information of a Wwise soundbank file.
An BNK file is a Wwise soundbank, i.e. an archive containing one or more audio files, together with event, effect, track and similar information.
It is part of the Wwise middleware.
Definition at line 46 of file wwisesoundbank.h.
|
private |
Enumerator | |
---|---|
kSoundTypeSFX | |
kSoundTypeVoice | |
kSoundTypeMusic |
Definition at line 83 of file wwisesoundbank.h.
Sound::WwiseSoundBank::WwiseSoundBank | ( | Common::SeekableReadStream * | bnk | ) |
Sound::WwiseSoundBank::WwiseSoundBank | ( | const Common::UString & | name | ) |
Definition at line 54 of file wwisesoundbank.cpp.
References _bnk, Common::UString::c_str(), Aurora::kFileTypeBNK, load(), Common::ScopedPtrBase< T, Deallocator >::reset(), and ResMan.
Sound::WwiseSoundBank::WwiseSoundBank | ( | uint64 | hash | ) |
Definition at line 62 of file wwisesoundbank.cpp.
References _bnk, Common::formatHash(), load(), Common::ScopedPtrBase< T, Deallocator >::reset(), and ResMan.
|
inline |
Definition at line 51 of file wwisesoundbank.h.
size_t Sound::WwiseSoundBank::findFileByID | ( | uint32 | id | ) | const |
Return the index of a file from its ID, or SIZE_MAX if not found.
Definition at line 108 of file wwisesoundbank.cpp.
size_t Sound::WwiseSoundBank::findSoundByID | ( | uint32 | id | ) | const |
Return the index of a sound from its ID, or SIZE_MAX if not found.
Definition at line 116 of file wwisesoundbank.cpp.
RewindableAudioStream * Sound::WwiseSoundBank::getFile | ( | size_t | index | ) | const |
Definition at line 124 of file wwisesoundbank.cpp.
References getFileData(), isEmptyFile(), Sound::makeWwRIFFVorbisStream(), and Common::ScopedPtrBase< T, Deallocator >::release().
size_t Sound::WwiseSoundBank::getFileCount | ( | ) | const |
Return the number of embedded files.
Definition at line 70 of file wwisesoundbank.cpp.
References _files.
|
private |
Definition at line 150 of file wwisesoundbank.cpp.
References _bnk, _dataOffset, getFileStruct(), Sound::WwiseSoundBank::File::offset, Sound::WwiseSoundBank::File::size, and SIZE_MAX.
Referenced by getFile().
uint32 Sound::WwiseSoundBank::getFileID | ( | size_t | index | ) | const |
Return the ID of an embedded file.
Definition at line 96 of file wwisesoundbank.cpp.
References getFileStruct(), and Sound::WwiseSoundBank::File::id.
|
private |
Definition at line 78 of file wwisesoundbank.cpp.
References _files, Common::UString::c_str(), and Common::composeString().
Referenced by getFileData(), getFileID(), and isEmptyFile().
RewindableAudioStream * Sound::WwiseSoundBank::getSound | ( | size_t | index | ) | const |
Definition at line 132 of file wwisesoundbank.cpp.
References getSoundData(), isEmptySound(), Sound::makeWwRIFFVorbisStream(), and Common::ScopedPtrBase< T, Deallocator >::release().
size_t Sound::WwiseSoundBank::getSoundCount | ( | ) | const |
Return the number of sounds this bank references.
Definition at line 74 of file wwisesoundbank.cpp.
References _sounds.
|
private |
Definition at line 161 of file wwisesoundbank.cpp.
References _bankID, _banks, _bnk, Common::UString::c_str(), Common::composeString(), getSoundStruct(), Aurora::kFileTypeBNK, Aurora::kFileTypeOGG, and ResMan.
Referenced by getSound().
uint32 Sound::WwiseSoundBank::getSoundFileID | ( | size_t | index | ) | const |
Return the ID of a file used by a referenced sound.
Definition at line 104 of file wwisesoundbank.cpp.
References Sound::WwiseSoundBank::Sound::fileID, and getSoundStruct().
uint32 Sound::WwiseSoundBank::getSoundID | ( | size_t | index | ) | const |
Return the ID of a referenced sound.
Definition at line 100 of file wwisesoundbank.cpp.
References getSoundStruct(), and Sound::WwiseSoundBank::Sound::id.
|
private |
Definition at line 87 of file wwisesoundbank.cpp.
References _sounds, Common::UString::c_str(), and Common::composeString().
Referenced by getSoundData(), getSoundFileID(), getSoundID(), and isEmptySound().
|
private |
Definition at line 140 of file wwisesoundbank.cpp.
References getFileStruct(), and Sound::WwiseSoundBank::File::size.
Referenced by getFile().
|
private |
Definition at line 144 of file wwisesoundbank.cpp.
References getSoundStruct().
Referenced by getSound().
|
private |
Definition at line 234 of file wwisesoundbank.cpp.
References _bankID, _banks, _dataOffset, _fileIDs, _files, _soundIDs, _sounds, Common::UString::c_str(), Common::composeString(), debugC(), Common::debugTag(), Common::ReadStream::eos(), Common::kDebugSound, Common::kEncodingASCII, Sound::kObjectMusicTrack, Sound::kObjectSound, Sound::kSectionBankHeader, Sound::kSectionData, Sound::kSectionDataIndex, Sound::kSectionObjects, Sound::kSectionSoundTypeID, kSoundTypeMusic, Common::SeekableReadStream::pos(), Common::ReadStream::readByte(), Common::readStringFixed(), Common::ReadStream::readUint32BE(), Common::ReadStream::readUint32LE(), Common::SeekableReadStream::seek(), Common::SeekableReadStream::size(), SIZE_MAX, and Common::SeekableReadStream::skip().
Referenced by WwiseSoundBank().
|
private |
Definition at line 106 of file wwisesoundbank.h.
Referenced by getSoundData(), and load().
|
private |
Definition at line 112 of file wwisesoundbank.h.
Referenced by getSoundData(), and load().
|
private |
Definition at line 104 of file wwisesoundbank.h.
Referenced by getFileData(), getSoundData(), and WwiseSoundBank().
|
private |
Definition at line 107 of file wwisesoundbank.h.
Referenced by getFileData(), and load().
|
private |
Definition at line 114 of file wwisesoundbank.h.
Referenced by findFileByID(), and load().
|
private |
Definition at line 109 of file wwisesoundbank.h.
Referenced by getFileCount(), getFileStruct(), and load().
|
private |
Definition at line 115 of file wwisesoundbank.h.
Referenced by findSoundByID(), and load().
|
private |
Definition at line 110 of file wwisesoundbank.h.
Referenced by getSoundCount(), getSoundStruct(), and load().